| 1 | <Page |
| 2 | x:Class="WslSettings.Views.OOBE.ShellPage" |
| 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | xmlns:animations="using:CommunityToolkit.WinUI.Animations" |
| 6 | xmlns:helpers="using:WslSettings.Helpers" |
| 7 | xmlns:behaviors="using:WslSettings.Behaviors" |
| 8 | xmlns:i="using:Microsoft.Xaml.Interactivity" |
| 9 | Loaded="OnLoaded"> |
| 10 | |
| 11 | <Grid> |
| 12 | <Grid.RowDefinitions> |
| 13 | <RowDefinition Height="Auto" /> |
| 14 | <RowDefinition Height="*" /> |
| 15 | </Grid.RowDefinitions> |
| 16 | <Button |
| 17 | x:Name="PaneToggleBtn" |
| 18 | Width="48" |
| 19 | HorizontalAlignment="Left" |
| 20 | VerticalAlignment="Center" |
| 21 | Click="PaneToggleBtn_Click" |
| 22 | Style="{StaticResource PaneToggleButtonStyle}" /> |
| 23 | <Grid Grid.Row="0" |
| 24 | x:Name="AppTitleBar" |
| 25 | Margin="16,0" |
| 26 | Canvas.ZIndex="1" |
| 27 | Height="{Binding ElementName=NavigationViewControl, Path=CompactPaneLength}" |
| 28 | IsHitTestVisible="True" |
| 29 | VerticalAlignment="Top" |
| 30 | HorizontalAlignment="Stretch"> |
| 31 | <animations:Implicit.Animations> |
| 32 | <animations:OffsetAnimation Duration="0:0:0.3" /> |
| 33 | </animations:Implicit.Animations> |
| 34 | <Grid.ColumnDefinitions> |
| 35 | <ColumnDefinition Width="Auto" /> |
| 36 | <ColumnDefinition Width="*" /> |
| 37 | </Grid.ColumnDefinitions> |
| 38 | <Image Grid.Column="0" |
| 39 | Source="/Assets/wsl.ico" |
| 40 | VerticalAlignment="Center" |
| 41 | HorizontalAlignment="Left" |
| 42 | Width="16" |
| 43 | Height="16" /> |
| 44 | <TextBlock Grid.Column="1" |
| 45 | x:Name="AppTitleBarText" |
| 46 | VerticalAlignment="Center" |
| 47 | TextWrapping="NoWrap" |
| 48 | Style="{StaticResource CaptionTextBlockStyle}" |
| 49 | Margin="16,0,0,0"/> |
| 50 | </Grid> |
| 51 | <NavigationView |
| 52 | Grid.Row="1" |
| 53 | x:Name="NavigationViewControl" |
| 54 | Canvas.ZIndex="0" |
| 55 | DisplayModeChanged="NavigationViewControl_DisplayModeChanged" |
| 56 | Header="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}" |
| 57 | IsBackButtonVisible="Collapsed" |
| 58 | IsBackEnabled="{x:Bind ViewModel.IsBackEnabled, Mode=OneWay}" |
| 59 | IsPaneOpen="True" |
| 60 | IsPaneToggleButtonVisible="False" |
| 61 | IsSettingsVisible="False" |
| 62 | ItemInvoked="NavigationViewControl_ItemInvoked" |
| 63 | OpenPaneLength="296" |
| 64 | PaneDisplayMode="Left" |
| 65 | SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}"> |
| 66 | <NavigationView.MenuItems> |
| 67 | <!-- |
| 68 | TODO: Update item titles by updating <x:Uid>.Content entries in Strings/en-us/Resources.resw. |
| 69 | https://docs.microsoft.com/windows/uwp/app-resources/localize-strings-ui-manifest#refer-to-a-string-resource-identifier-from-xaml |
| 70 | |
| 71 | TODO: Update item icons by updating FontIcon.Glyph properties. |
| 72 | https://docs.microsoft.com/windows/apps/design/style/segoe-fluent-icons-font#icon-list |
| 73 | --> |
| 74 | <NavigationViewItem x:Uid="Settings_Shell_General" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.GeneralViewModel"> |
| 75 | <NavigationViewItem.Icon> |
| 76 | <BitmapIcon ShowAsMonochrome="False" UriSource="/Assets/wslbw.ico" /> |
| 77 | </NavigationViewItem.Icon> |
| 78 | </NavigationViewItem> |
| 79 | <NavigationViewItem x:Uid="Settings_Shell_WorkingAcrossFileSystems" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.WorkingAcrossFileSystemsViewModel"> |
| 80 | <NavigationViewItem.Icon> |
| 81 | <BitmapIcon ShowAsMonochrome="False" UriSource="/Assets/SettingsOOBEFileExplorerIcon.png" /> |
| 82 | </NavigationViewItem.Icon> |
| 83 | </NavigationViewItem> |
| 84 | <NavigationViewItem x:Uid="Settings_Shell_GUIApps" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.GUIAppsViewModel"> |
| 85 | <NavigationViewItem.Icon> |
| 86 | <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/> |
| 87 | </NavigationViewItem.Icon> |
| 88 | </NavigationViewItem> |
| 89 | <NavigationViewItem x:Uid="Settings_Shell_GPUAcceleration" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.GPUAccelerationViewModel"> |
| 90 | <NavigationViewItem.Icon> |
| 91 | <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/> |
| 92 | </NavigationViewItem.Icon> |
| 93 | </NavigationViewItem> |
| 94 | <NavigationViewItem x:Uid="Settings_Shell_NetworkingIntegration" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.NetworkingIntegrationViewModel"> |
| 95 | <NavigationViewItem.Icon> |
| 96 | <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/> |
| 97 | </NavigationViewItem.Icon> |
| 98 | </NavigationViewItem> |
| 99 | <NavigationViewItem x:Uid="Settings_Shell_DistroManagement" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.DistroManagementViewModel"> |
| 100 | <NavigationViewItem.Icon> |
| 101 | <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/> |
| 102 | </NavigationViewItem.Icon> |
| 103 | </NavigationViewItem> |
| 104 | <NavigationViewItemSeparator/> |
| 105 | <NavigationViewItem x:Uid="Settings_Shell_DockerDesktopIntegration" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.DockerDesktopIntegrationViewModel"> |
| 106 | <NavigationViewItem.Icon> |
| 107 | <BitmapIcon ShowAsMonochrome="False" UriSource="/Assets/SettingsOOBEDockerIcon.png" /> |
| 108 | </NavigationViewItem.Icon> |
| 109 | </NavigationViewItem> |
| 110 | <NavigationViewItem x:Uid="Settings_Shell_VSCodeIntegration" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.VSCodeIntegrationViewModel"> |
| 111 | <NavigationViewItem.Icon> |
| 112 | <BitmapIcon ShowAsMonochrome="False" UriSource="/Assets/SettingsOOBEVSCodeIcon.png" /> |
| 113 | </NavigationViewItem.Icon> |
| 114 | </NavigationViewItem> |
| 115 | <NavigationViewItem x:Uid="Settings_Shell_VSIntegration" helpers:NavigationHelper.NavigateTo="WslSettings.ViewModels.OOBE.VSIntegrationViewModel"> |
| 116 | <NavigationViewItem.Icon> |
| 117 | <BitmapIcon ShowAsMonochrome="False" UriSource="/Assets/SettingsOOBEVSIcon.png" /> |
| 118 | </NavigationViewItem.Icon> |
| 119 | </NavigationViewItem> |
| 120 | </NavigationView.MenuItems> |
| 121 | <NavigationView.FooterMenuItems> |
| 122 | <!-- |
| 123 | TODO: Update item titles by updating <x:Uid>.Content entries in Strings/en-us/Resources.resw. |
| 124 | https://docs.microsoft.com/windows/uwp/app-resources/localize-strings-ui-manifest#refer-to-a-string-resource-identifier-from-xaml |
| 125 | |
| 126 | TODO: Update item icons by updating FontIcon.Glyph properties. |
| 127 | https://docs.microsoft.com/windows/apps/design/style/segoe-fluent-icons-font#icon-list |
| 128 | --> |
| 129 | <NavigationViewItem x:Uid="Settings_Shell_WhatsNew" Visibility="Collapsed"> |
| 130 | <NavigationViewItem.Icon> |
| 131 | <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/> |
| 132 | </NavigationViewItem.Icon> |
| 133 | </NavigationViewItem> |
| 134 | <NavigationViewItem x:Uid="Settings_Shell_Settings" Tag="Settings" SelectsOnInvoked="False"> |
| 135 | <NavigationViewItem.Icon> |
| 136 | <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/> |
| 137 | </NavigationViewItem.Icon> |
| 138 | </NavigationViewItem> |
| 139 | </NavigationView.FooterMenuItems> |
| 140 | <NavigationView.HeaderTemplate> |
| 141 | <DataTemplate> |
| 142 | <Grid> |
| 143 | <TextBlock |
| 144 | Text="{Binding}" |
| 145 | Style="{ThemeResource TitleTextBlockStyle}" /> |
| 146 | </Grid> |
| 147 | </DataTemplate> |
| 148 | </NavigationView.HeaderTemplate> |
| 149 | <i:Interaction.Behaviors> |
| 150 | <behaviors:NavigationViewHeaderBehavior |
| 151 | DefaultHeader="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}"> |
| 152 | <behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate> |
| 153 | <DataTemplate> |
| 154 | <Grid> |
| 155 | <TextBlock |
| 156 | Text="{Binding}" |
| 157 | Style="{ThemeResource TitleTextBlockStyle}" /> |
| 158 | </Grid> |
| 159 | </DataTemplate> |
| 160 | </behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate> |
| 161 | </behaviors:NavigationViewHeaderBehavior> |
| 162 | </i:Interaction.Behaviors> |
| 163 | <Grid> |
| 164 | <Frame x:Name="NavigationFrame" /> |
| 165 | </Grid> |
| 166 | </NavigationView> |
| 167 | |
| 168 | <VisualStateManager.VisualStateGroups> |
| 169 | <VisualStateGroup x:Name="LayoutVisualStates"> |
| 170 | <VisualState x:Name="WideLayout"> |
| 171 | <VisualState.StateTriggers> |
| 172 | <AdaptiveTrigger MinWindowWidth="720" /> |
| 173 | </VisualState.StateTriggers> |
| 174 | </VisualState> |
| 175 | <VisualState x:Name="SmallLayout"> |
| 176 | <VisualState.StateTriggers> |
| 177 | <AdaptiveTrigger MinWindowWidth="600" /> |
| 178 | <AdaptiveTrigger MinWindowWidth="0" /> |
| 179 | </VisualState.StateTriggers> |
| 180 | <VisualState.Setters> |
| 181 | <Setter Target="NavigationViewControl.PaneDisplayMode" Value="LeftMinimal" /> |
| 182 | </VisualState.Setters> |
| 183 | </VisualState> |
| 184 | </VisualStateGroup> |
| 185 | </VisualStateManager.VisualStateGroups> |
| 186 | </Grid> |
| 187 | </Page> |