|
5 | 5 |
|
6 | 6 | <ResourceDictionary.ThemeDictionaries>
|
7 | 7 | <ResourceDictionary x:Key="Dark">
|
8 |
| - <StaticResource x:Key="NavigationViewItemBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> |
9 |
| - <StaticResource x:Key="NavigationViewItemBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> |
| 8 | + <StaticResource x:Key="NavigationViewItemBackgroundPointerOver" ResourceKey="ControlFillColorSecondaryBrush" /> |
| 9 | + <StaticResource x:Key="NavigationViewItemBackgroundPressed" ResourceKey="ControlFillColorTertiaryBrush" /> |
10 | 10 | <StaticResource x:Key="NavigationViewItemBackgroundSelected" ResourceKey="ControlFillColorDefaultBrush" />
|
11 | 11 | <StaticResource x:Key="NavigationViewItemBackgroundSelectedPointerOver" ResourceKey="ControlFillColorDefaultBrush" />
|
12 | 12 | <StaticResource x:Key="NavigationViewItemBackgroundSelectedPressed" ResourceKey="ControlFillColorDefaultBrush" />
|
|
66 | 66 | <Setter Property="Template">
|
67 | 67 | <Setter.Value>
|
68 | 68 | <ControlTemplate TargetType="primitives:NavigationViewItemPresenter">
|
| 69 | + |
69 | 70 | <Grid
|
70 | 71 | x:Name="LayoutRoot"
|
71 | 72 | MinHeight="{ThemeResource NavigationViewItemOnLeftMinHeight}"
|
|
78 | 79 | </Grid.BackgroundTransition>
|
79 | 80 |
|
80 | 81 | <!-- Selection indicator -->
|
81 |
| - <Rectangle |
82 |
| - x:Name="SelectionIndicator" |
83 |
| - Width="{ThemeResource NavigationViewSelectionIndicatorWidth}" |
84 |
| - Height="{ThemeResource NavigationViewSelectionIndicatorHeight}" |
85 |
| - HorizontalAlignment="Left" |
86 |
| - VerticalAlignment="Center" |
87 |
| - Fill="{ThemeResource NavigationViewSelectionIndicatorForeground}" |
88 |
| - Opacity="0.0" |
89 |
| - RadiusX="{ThemeResource NavigationViewSelectionIndicatorRadius}" |
90 |
| - RadiusY="{ThemeResource NavigationViewSelectionIndicatorRadius}" /> |
| 82 | + <Grid HorizontalAlignment="Left" VerticalAlignment="Center"> |
| 83 | + <Rectangle |
| 84 | + x:Name="SelectionIndicator" |
| 85 | + Width="{ThemeResource NavigationViewSelectionIndicatorWidth}" |
| 86 | + Height="{ThemeResource NavigationViewSelectionIndicatorHeight}" |
| 87 | + Fill="{ThemeResource NavigationViewSelectionIndicatorForeground}" |
| 88 | + Opacity="0.0" |
| 89 | + RadiusX="{ThemeResource NavigationViewSelectionIndicatorRadius}" |
| 90 | + RadiusY="{ThemeResource NavigationViewSelectionIndicatorRadius}" /> |
| 91 | + </Grid> |
91 | 92 |
|
92 | 93 | <!-- Content grid -->
|
93 | 94 | <ContentPresenter
|
94 | 95 | x:Name="ContentPresenter"
|
95 |
| - Grid.Column="1" |
96 | 96 | MinHeight="{ThemeResource NavigationViewItemOnLeftMinHeight}"
|
97 | 97 | Margin="{ThemeResource NavigationViewItemContentPresenterMargin}"
|
98 | 98 | Padding="{TemplateBinding Padding}"
|
|
170 | 170 | </VisualStateGroup>
|
171 | 171 | </VisualStateManager.VisualStateGroups>
|
172 | 172 | </Grid>
|
| 173 | + |
| 174 | + </ControlTemplate> |
| 175 | + </Setter.Value> |
| 176 | + </Setter> |
| 177 | + </Style> |
| 178 | + |
| 179 | + <Style TargetType="NavigationViewItem"> |
| 180 | + <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" /> |
| 181 | + <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" /> |
| 182 | + <Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}" /> |
| 183 | + <Setter Property="BorderThickness" Value="{StaticResource NavigationViewItemBorderThickness}" /> |
| 184 | + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> |
| 185 | + <Setter Property="FontWeight" Value="Normal" /> |
| 186 | + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> |
| 187 | + <Setter Property="Margin" Value="{ThemeResource NavigationViewItemMargin}" /> |
| 188 | + <Setter Property="UseSystemFocusVisuals" Value="True" /> |
| 189 | + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
| 190 | + <Setter Property="TabNavigation" Value="Once" /> |
| 191 | + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> |
| 192 | + <Setter Property="Template"> |
| 193 | + <Setter.Value> |
| 194 | + <ControlTemplate TargetType="NavigationViewItem"> |
| 195 | + |
| 196 | + <Grid x:Name="NVIRootGrid"> |
| 197 | + <Grid.RowDefinitions> |
| 198 | + <RowDefinition Height="*" /> |
| 199 | + <RowDefinition Height="Auto" /> |
| 200 | + </Grid.RowDefinitions> |
| 201 | + <Grid.BackgroundTransition> |
| 202 | + <BrushTransition Duration="0:0:0.083" /> |
| 203 | + </Grid.BackgroundTransition> |
| 204 | + |
| 205 | + <!-- Primitive NavigationViewItem Presenter --> |
| 206 | + <primitives:NavigationViewItemPresenter |
| 207 | + x:Name="NavigationViewItemPresenter" |
| 208 | + Margin="{TemplateBinding Margin}" |
| 209 | + Padding="{TemplateBinding Padding}" |
| 210 | + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
| 211 | + VerticalAlignment="{TemplateBinding VerticalAlignment}" |
| 212 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 213 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 214 | + Background="{TemplateBinding Background}" |
| 215 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 216 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 217 | + Content="{TemplateBinding Content}" |
| 218 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 219 | + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" |
| 220 | + ContentTransitions="{TemplateBinding ContentTransitions}" |
| 221 | + Control.IsTemplateFocusTarget="True" |
| 222 | + CornerRadius="{TemplateBinding CornerRadius}" |
| 223 | + Foreground="{TemplateBinding Foreground}" |
| 224 | + Icon="{TemplateBinding Icon}" |
| 225 | + IsTabStop="false" |
| 226 | + UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}" /> |
| 227 | + |
| 228 | + <!-- NavigationViewItem's MenuItems Repeater --> |
| 229 | + <ItemsRepeater |
| 230 | + x:Name="NavigationViewItemMenuItemsHost" |
| 231 | + Grid.Row="1" |
| 232 | + Visibility="Collapsed"> |
| 233 | + <ItemsRepeater.Layout> |
| 234 | + <StackLayout Orientation="Vertical" /> |
| 235 | + </ItemsRepeater.Layout> |
| 236 | + </ItemsRepeater> |
| 237 | + |
| 238 | + <!-- NavigationViewItem's Flyout --> |
| 239 | + <FlyoutBase.AttachedFlyout> |
| 240 | + <Flyout x:Name="ChildrenFlyout" Placement="RightEdgeAlignedTop"> |
| 241 | + <Flyout.FlyoutPresenterStyle> |
| 242 | + <Style TargetType="FlyoutPresenter"> |
| 243 | + <Setter Property="Padding" Value="{ThemeResource NavigationViewItemChildrenMenuFlyoutPadding}" /> |
| 244 | + <!-- Set negative top margin to make the flyout align exactly with the button --> |
| 245 | + <Setter Property="Margin" Value="0,-4,0,0" /> |
| 246 | + <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> |
| 247 | + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> |
| 248 | + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" /> |
| 249 | + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
| 250 | + <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" /> |
| 251 | + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> |
| 252 | + <Setter Property="Template"> |
| 253 | + <Setter.Value> |
| 254 | + <ControlTemplate TargetType="FlyoutPresenter"> |
| 255 | + <ScrollViewer |
| 256 | + x:Name="ScrollViewer" |
| 257 | + AutomationProperties.AccessibilityView="Raw" |
| 258 | + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
| 259 | + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" |
| 260 | + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" |
| 261 | + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" |
| 262 | + ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> |
| 263 | + <ContentPresenter |
| 264 | + x:Name="ContentPresenter" |
| 265 | + Padding="{TemplateBinding Padding}" |
| 266 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 267 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 268 | + Background="{TemplateBinding Background}" |
| 269 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 270 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 271 | + Content="{TemplateBinding Content}" |
| 272 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 273 | + ContentTransitions="{TemplateBinding ContentTransitions}" |
| 274 | + CornerRadius="{TemplateBinding CornerRadius}" /> |
| 275 | + </ScrollViewer> |
| 276 | + </ControlTemplate> |
| 277 | + </Setter.Value> |
| 278 | + </Setter> |
| 279 | + </Style> |
| 280 | + </Flyout.FlyoutPresenterStyle> |
| 281 | + <Grid x:Name="FlyoutRootGrid"> |
| 282 | + <Grid x:Name="FlyoutContentGrid" /> |
| 283 | + </Grid> |
| 284 | + </Flyout> |
| 285 | + </FlyoutBase.AttachedFlyout> |
| 286 | + |
| 287 | + <VisualStateManager.VisualStateGroups> |
| 288 | + <VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates"> |
| 289 | + <VisualState x:Name="OnLeftNavigation"> |
| 290 | + <VisualState.Setters> |
| 291 | + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPane}" /> |
| 292 | + </VisualState.Setters> |
| 293 | + </VisualState> |
| 294 | + <VisualState x:Name="OnLeftNavigationReveal"> |
| 295 | + <VisualState.Setters> |
| 296 | + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPaneWithRevealFocus}" /> |
| 297 | + </VisualState.Setters> |
| 298 | + </VisualState> |
| 299 | + <VisualState x:Name="OnTopNavigationPrimary"> |
| 300 | + <VisualState.Setters> |
| 301 | + <Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" /> |
| 302 | + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" /> |
| 303 | + <Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" /> |
| 304 | + </VisualState.Setters> |
| 305 | + </VisualState> |
| 306 | + <VisualState x:Name="OnTopNavigationPrimaryReveal"> |
| 307 | + <VisualState.Setters> |
| 308 | + <Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" /> |
| 309 | + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus}" /> |
| 310 | + <Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" /> |
| 311 | + </VisualState.Setters> |
| 312 | + </VisualState> |
| 313 | + <VisualState x:Name="OnTopNavigationOverflow"> |
| 314 | + <VisualState.Setters> |
| 315 | + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}" /> |
| 316 | + </VisualState.Setters> |
| 317 | + </VisualState> |
| 318 | + </VisualStateGroup> |
| 319 | + </VisualStateManager.VisualStateGroups> |
| 320 | + </Grid> |
| 321 | + |
173 | 322 | </ControlTemplate>
|
174 | 323 | </Setter.Value>
|
175 | 324 | </Setter>
|
|
0 commit comments