-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layout Cycle Crash + Misc Fixes for NavigationView #5084
Changes from 17 commits
275cdc9
e36718c
06f90d7
18b686a
026ab45
1ee640f
4c7ed20
c0ae763
24a3ad8
24c4ed4
4b91172
74d03fe
642124d
c3c4811
db5b373
81ab023
2b6a3ea
35bd4b0
34a930a
30a4f0c
c273364
c89a7a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,11 @@ | |
</VisualState.Setters> | ||
</VisualState> | ||
|
||
<VisualState x:Name="TopNavigationMinimal" /> | ||
<VisualState x:Name="TopNavigationMinimal"> | ||
<VisualState.Setters> | ||
<Setter Target="ContentGrid.BorderThickness" Value="{ThemeResource TopNavigationViewContentGridBorderThickness}" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
|
||
<VisualState x:Name="MinimalWithBackButton"> | ||
<VisualState.Setters> | ||
|
@@ -181,10 +185,10 @@ | |
</VisualStateGroup> | ||
|
||
<VisualStateGroup x:Name="PaneSeparatorStates"> | ||
<VisualState x:Name="SeparatorCollapsed"/> | ||
<VisualState x:Name="SeparatorVisible"> | ||
<VisualState x:Name="SeparatorVisible"/> | ||
<VisualState x:Name="SeparatorCollapsed"> | ||
<VisualState.Setters> | ||
<Setter Target="VisualItemsSeparator.Visibility" Value="Visible"/> | ||
<Setter Target="VisualItemsSeparator.Visibility" Value="Collapsed"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, why is this switched now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh oops. I was previously getting the separator ActualHeight from codebehind, and for it to evaluate to a non-zero value, it needed to be visible by default. The separator is no longer used for pane layout calculations, so I should revert this. |
||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
|
@@ -585,7 +589,7 @@ | |
x:Name="VisualItemsSeparator" | ||
Grid.Row="1" | ||
Margin="0,0,0,2" | ||
Visibility="Collapsed" | ||
Visibility="Visible" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Stretch"/> | ||
|
||
|
@@ -614,8 +618,11 @@ | |
<SplitView.Content> | ||
<Grid | ||
x:Name="ContentGrid" | ||
BorderBrush="{ThemeResource NavigationViewContentGridBorderBrush}" | ||
BorderThickness="{ThemeResource NavigationViewContentGridBorderThickness}" | ||
Background="{ThemeResource NavigationViewContentBackground}" | ||
Margin="{ThemeResource NavigationViewContentMargin}"> | ||
Margin="{ThemeResource NavigationViewContentMargin}" | ||
contract7Present:CornerRadius="{ThemeResource NavigationViewContentGridCornerRadius}"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
|
@@ -646,6 +653,7 @@ | |
Style="{StaticResource NavigationViewTitleHeaderContentControlTextStyle}"/> | ||
|
||
<ContentPresenter | ||
x:Name="ContentPresenter" | ||
AutomationProperties.LandmarkType="Main" | ||
Grid.Row="2" | ||
Grid.ColumnSpan="2" | ||
|
@@ -899,7 +907,6 @@ | |
<Setter Property="IsEnabled" Value="False" /> | ||
<Setter Property="IsTabStop" Value="False" /> | ||
<Setter Property="MinHeight" Value="0" /> | ||
<Setter Property="Margin" Value="{ThemeResource NavigationViewItemSeparatorMargin}" /> | ||
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
|
@@ -928,7 +935,7 @@ | |
x:Name="SeparatorLine" | ||
Height="{ThemeResource NavigationViewItemSeparatorHeight}" | ||
Fill="{ThemeResource NavigationViewItemSeparatorForeground}" | ||
Margin="{TemplateBinding Margin}"/> | ||
Margin="{ThemeResource NavigationViewItemSeparatorMargin}"/> | ||
beervoley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike ActualHeight/ActualWidth, UIElement.DesiredSize already includes the Margin. So it should be:
const auto menuItemsDesiredHeight = menuItems.DesiredSize().Height;