Skip to content
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

NavigationView: Add more theme resources to configure margins #2923

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions dev/NavigationView/NavigationView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
x:Name="TopNavOverflowButton"
Grid.Column="4"
Content="More"
Margin="{ThemeResource TopNavigationViewOverflowButtonMargin}"
Style="{StaticResource NavigationViewOverflowButtonStyleWhenPaneOnTop}"
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OverflowButtonVisibility}">

Expand Down Expand Up @@ -326,7 +327,7 @@

<ContentControl
x:Name="TopPaneAutoSuggestBoxPresenter"
Margin="12,0,12,0"
Margin="{ThemeResource TopNavigationViewAutoSuggestBoxMargin}"
MinWidth="48"
IsTabStop="False"
HorizontalContentAlignment="Stretch"
Expand Down Expand Up @@ -530,6 +531,7 @@
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="Margin" Value="{ThemeResource NavigationViewItemMargin}" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="TabNavigation" Value="Once"/>
Expand Down Expand Up @@ -557,13 +559,15 @@
</VisualState>
<VisualState x:Name="OnTopNavigationPrimary">
<VisualState.Setters>
<Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}"/>
<Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" />
<contract7NotPresent:Setter Target="ChildrenFlyout.Placement" Value="Bottom"/>
<contract7Present:Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="OnTopNavigationPrimaryReveal">
<VisualState.Setters>
<Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}"/>
<Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus}" />
<contract7NotPresent:Setter Target="ChildrenFlyout.Placement" Value="Bottom"/>
<contract7Present:Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft"/>
Expand Down Expand Up @@ -743,7 +747,7 @@
x:Name="SeparatorLine"
Height="{ThemeResource NavigationViewItemSeparatorHeight}"
Margin="{ThemeResource NavigationViewItemSeparatorMargin}"
Fill="{ThemeResource NavigationViewItemSeparatorForeground}" />
Fill="{ThemeResource NavigationViewItemSeparatorForeground}" />
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down
4 changes: 4 additions & 0 deletions dev/NavigationView/NavigationView_rs1_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
</ResourceDictionary.ThemeDictionaries>

<Thickness x:Key="NavigationViewAutoSuggestBoxMargin">10,0,16,0</Thickness>
<Thickness x:Key="TopNavigationViewAutoSuggestBoxMargin">12,0,12,0</Thickness>
<x:Double x:Key="PaneToggleButtonSize">40</x:Double>
<x:Double x:Key="PaneToggleButtonHeight">40</x:Double>
<x:Double x:Key="PaneToggleButtonWidth">40</x:Double>
Expand All @@ -245,9 +246,12 @@
<Thickness x:Key="NavigationViewMinimalHeaderMargin">8,5,0,0</Thickness>
<Thickness x:Key="NavigationViewHeaderMargin">12,5,0,11</Thickness>
<Thickness x:Key="NavigationViewPaneTitlePresenterMargin">8,4,0,0</Thickness>
<Thickness x:Key="NavigationViewItemMargin">0</Thickness>
<Thickness x:Key="TopNavigationViewItemMargin">0</Thickness>
<Thickness x:Key="NavigationViewItemSeparatorMargin">16,10</Thickness>
<Thickness x:Key="NavigationViewCompactItemSeparatorMargin">16,10</Thickness>
<Thickness x:Key="TopNavigationViewItemSeparatorMargin">10,0</Thickness>
<Thickness x:Key="TopNavigationViewOverflowButtonMargin">0</Thickness>
<Thickness x:Key="NavigationViewItemContentPresenterMargin">0,0,20,0</Thickness>
<Thickness x:Key="NavigationViewCompactItemContentPresenterMargin">0,0,16,0</Thickness>
<Thickness x:Key="TopNavigationViewItemContentPresenterMargin">8,0,16,0</Thickness>
Expand Down