WIn_RustTools/RustTools/Views/ShellPage.xaml

96 lines
4.2 KiB
Plaintext
Raw Normal View History

2024-07-14 11:24:10 +00:00
<Page
x:Class="RustTools.Views.ShellPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:behaviors="using:RustTools.Behaviors"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:RustTools.Helpers"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Loaded="OnLoaded">
<Grid>
<Grid
x:Name="AppTitleBar"
Height="{Binding ElementName=NavigationViewControl, Path=CompactPaneLength}"
VerticalAlignment="Top"
Canvas.ZIndex="1"
IsHitTestVisible="True">
<Image
Width="16"
Height="16"
HorizontalAlignment="Left"
Source="/Assets/WindowIcon.ico" />
<TextBlock
x:Name="AppTitleBarText"
Margin="28,0,0,0"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
TextWrapping="NoWrap" />
</Grid>
<NavigationView
x:Name="NavigationViewControl"
Canvas.ZIndex="0"
DisplayModeChanged="NavigationViewControl_DisplayModeChanged"
ExpandedModeThresholdWidth="1280"
Header="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}"
IsBackButtonVisible="Visible"
IsBackEnabled="{x:Bind ViewModel.IsBackEnabled, Mode=OneWay}"
IsSettingsVisible="True"
SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}">
<NavigationView.MenuItems>
<NavigationViewItem
x:Uid="HomePage"
helpers:NavigationHelper.NavigateTo="RustTools.ViewModels.HomePageViewModel"
2024-08-17 23:27:24 +00:00
Icon="Home"
Tag="HomePage" />
2024-07-14 11:24:10 +00:00
<NavigationViewItem
x:Uid="Concern"
2024-07-15 05:22:53 +00:00
helpers:NavigationHelper.NavigateTo="RustTools.ViewModels.ConcernViewModel"
2024-08-17 23:27:24 +00:00
Icon="ContactInfo"
Tag="Concern" />
2024-07-14 11:24:10 +00:00
<NavigationViewItem
x:Uid="Ranking"
2024-07-15 05:22:53 +00:00
helpers:NavigationHelper.NavigateTo="RustTools.ViewModels.RankingViewModel"
2024-08-17 23:27:24 +00:00
Icon="List"
Tag="Ranking" />
2024-07-14 11:24:10 +00:00
<NavigationViewItem
x:Uid="User"
2024-07-15 05:22:53 +00:00
helpers:NavigationHelper.NavigateTo="RustTools.ViewModels.UserViewModel"
2024-08-17 23:27:24 +00:00
Icon="Contact2"
Tag="User" />
<NavigationViewItem
x:Uid="Module"
helpers:NavigationHelper.NavigateTo="RustTools.ViewModels.ModuleViewModel"
Tag="Module">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE838;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
2024-07-14 11:24:10 +00:00
</NavigationView.MenuItems>
<NavigationView.HeaderTemplate>
<DataTemplate>
<Grid>
<TextBlock Style="{ThemeResource TitleTextBlockStyle}" Text="{Binding}" />
</Grid>
</DataTemplate>
</NavigationView.HeaderTemplate>
2024-08-17 23:27:24 +00:00
2024-07-14 11:24:10 +00:00
<i:Interaction.Behaviors>
<behaviors:NavigationViewHeaderBehavior DefaultHeader="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}">
<behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
<DataTemplate>
<Grid>
<TextBlock Style="{ThemeResource TitleTextBlockStyle}" Text="{Binding}" />
</Grid>
</DataTemplate>
</behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
</behaviors:NavigationViewHeaderBehavior>
</i:Interaction.Behaviors>
<Grid Margin="{StaticResource NavigationViewPageContentMargin}">
<Frame x:Name="NavigationFrame" />
</Grid>
</NavigationView>
</Grid>
</Page>