|
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
5 | 5 | xmlns:local="using:VBA10"
|
| 6 | + xmlns:controls="using:VBA10.Controls" |
6 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
7 | 8 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
8 | 9 | mc:Ignorable="d">
|
9 | 10 |
|
10 |
| - |
| 11 | + <Page.Resources> |
| 12 | + <DataTemplate x:Key="NavMenuItemTemplate" x:DataType="local:NavMenuItem"> |
| 13 | + <Grid> |
| 14 | + <Grid.ColumnDefinitions> |
| 15 | + <ColumnDefinition Width="48" /> |
| 16 | + <ColumnDefinition /> |
| 17 | + </Grid.ColumnDefinitions> |
| 18 | + <!-- Showing a ToolTip and the Label is redundant. We put the ToolTip on the icon. |
| 19 | + It appears when the user hovers over the icon, but not the label which provides |
| 20 | + value when the SplitView is 'Compact' while reducing the likelihood of showing |
| 21 | + redundant information when the label is shown.--> |
| 22 | + <FontIcon x:Name="Glyph" FontSize="16" Glyph="{x:Bind SymbolAsChar}" |
| 23 | + VerticalAlignment="Center" HorizontalAlignment="Center" |
| 24 | + ToolTipService.ToolTip="{x:Bind Label}" |
| 25 | + Foreground="White"/> |
| 26 | + <TextBlock x:Name="Text" Grid.Column="1" Text="{x:Bind Label}" |
| 27 | + Foreground="White"/> |
| 28 | + </Grid> |
| 29 | + </DataTemplate> |
| 30 | + </Page.Resources> |
| 31 | + |
| 32 | + |
11 | 33 | <SwapChainPanel x:Name="swapChainPanel">
|
| 34 | + |
| 35 | + <!-- Adaptive triggers --> |
| 36 | + <VisualStateManager.VisualStateGroups> |
| 37 | + <VisualStateGroup> |
| 38 | + <VisualState> |
| 39 | + <VisualState.StateTriggers> |
| 40 | + <AdaptiveTrigger MinWindowWidth="720" /> |
| 41 | + </VisualState.StateTriggers> |
| 42 | + <VisualState.Setters> |
| 43 | + <!--<Setter Target="RootSplitView.DisplayMode" Value="CompactInline"/> |
| 44 | + <Setter Target="RootSplitView.IsPaneOpen" Value="True"/>--> |
| 45 | + <Setter Target="RootSplitView.OpenPaneLength" Value="256"/> |
| 46 | + </VisualState.Setters> |
| 47 | + </VisualState> |
| 48 | + <VisualState> |
| 49 | + <VisualState.StateTriggers> |
| 50 | + <AdaptiveTrigger MinWindowWidth="0" /> |
| 51 | + </VisualState.StateTriggers> |
| 52 | + <VisualState.Setters> |
| 53 | + <!--<Setter Target="RootSplitView.DisplayMode" Value="Overlay"/>--> |
| 54 | + <Setter Target="RootSplitView.OpenPaneLength" Value="150"/> |
| 55 | + </VisualState.Setters> |
| 56 | + </VisualState> |
| 57 | + </VisualStateGroup> |
| 58 | + </VisualStateManager.VisualStateGroups> |
| 59 | + |
| 60 | + <!-- Top-level navigation menu + app content --> |
| 61 | + <SplitView x:Name="RootSplitView" |
| 62 | + DisplayMode="Inline" |
| 63 | + OpenPaneLength="100" |
| 64 | + IsTabStop="False" |
| 65 | + > |
| 66 | + <SplitView.Pane> |
| 67 | + <RelativePanel Background="#FF4D3A89"> |
| 68 | + <!-- A custom ListView to display the items in the pane. The automation Name is set in the ContainerContentChanging event. --> |
| 69 | + <controls:NavMenuListView x:Name="NavMenuList" |
| 70 | + TabIndex="3" |
| 71 | + Margin="0,48,0,0" |
| 72 | + ContainerContentChanging="NavMenuItemContainerContentChanging" |
| 73 | + ItemContainerStyle="{StaticResource NavMenuItemContainerStyle}" |
| 74 | + ItemTemplate="{StaticResource NavMenuItemTemplate}" |
| 75 | + ItemInvoked="NavMenuList_ItemInvoked"> |
| 76 | + <!--<controls:NavMenuListView.Header> |
| 77 | + --><!-- Using this custom back navigation button until the system-provided back button is enabled. --><!-- |
| 78 | + <Button x:Name="BackButton" |
| 79 | + TabIndex="2" |
| 80 | + Style="{StaticResource NavigationBackButtonStyle}" |
| 81 | + IsEnabled="{x:Bind AppFrame.CanGoBack, Mode=OneWay}" |
| 82 | + HorizontalAlignment="{Binding ItemsPanelRoot.HorizontalAlignment, ElementName=NavMenuList}" |
| 83 | + Click="BackButton_Click"/> |
| 84 | + </controls:NavMenuListView.Header>--> |
| 85 | + </controls:NavMenuListView> |
| 86 | + </RelativePanel> |
| 87 | + |
| 88 | + </SplitView.Pane> |
| 89 | + |
| 90 | + <!-- OnNavigatingToPage we synchronize the selected item in the nav menu with the current page. |
| 91 | + OnNavigatedToPage we move keyboard focus to the first item on the page after it's loaded. --> |
| 92 | + <Frame x:Name="frame"> |
| 93 | + <!--Navigating="OnNavigatingToPage" |
| 94 | + Navigated="OnNavigatedToPage"--> |
| 95 | + |
| 96 | + <Frame.ContentTransitions> |
| 97 | + <TransitionCollection> |
| 98 | + <NavigationThemeTransition> |
| 99 | + <NavigationThemeTransition.DefaultNavigationTransitionInfo> |
| 100 | + <EntranceNavigationTransitionInfo/> |
| 101 | + </NavigationThemeTransition.DefaultNavigationTransitionInfo> |
| 102 | + </NavigationThemeTransition> |
| 103 | + </TransitionCollection> |
| 104 | + </Frame.ContentTransitions> |
| 105 | + </Frame> |
| 106 | + </SplitView> |
| 107 | + |
| 108 | + <!-- Declared last to have it rendered above everything else, but it needs to be the first item in the tab sequence. --> |
| 109 | + <ToggleButton x:Name="TogglePaneButton" |
| 110 | + TabIndex="1" |
| 111 | + Style="{StaticResource SplitViewTogglePaneButtonStyle}" |
| 112 | + IsChecked="{Binding IsPaneOpen, ElementName=RootSplitView, Mode=TwoWay}" |
| 113 | + Unchecked="TogglePaneButton_Checked" |
| 114 | + AutomationProperties.Name="Menu" |
| 115 | + ToolTipService.ToolTip="Menu" |
| 116 | + /> |
| 117 | + |
12 | 118 | </SwapChainPanel>
|
13 | 119 |
|
14 | 120 | <Page.BottomAppBar>
|
|
0 commit comments