Skip to content

Commit

Permalink
Merge pull request #4738 from CommunityToolkit/ListDetailsView.ListPa…
Browse files Browse the repository at this point in the history
…neWidth-NRE-fix

ListDetailsView.ListPaneWidth Null check fix
  • Loading branch information
michael-hawker authored Sep 2, 2022
2 parents bba01d7 + f3cb295 commit db12288
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<controls:ListDetailsView BackButtonBehavior="Automatic"
ItemsSource="{Binding Emails}"
NoSelectionContent="Select an item to view"
CompactModeThresholdWidth="720">
CompactModeThresholdWidth="720"
ListPaneWidth="400">
<controls:ListDetailsView.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,10 @@ protected override void OnItemsChanged(object e)
/// </summary>
private void OnListPaneWidthChanged()
{
_twoPaneView.Pane1Length = new GridLength(ListPaneWidth);
if (_twoPaneView != null)
{
_twoPaneView.Pane1Length = new GridLength(ListPaneWidth);
}
}
}
}

0 comments on commit db12288

Please sign in to comment.