WIn_RustTools/RustTools/Views/ShellPage.xaml

138 lines
6.0 KiB
Plaintext
Raw Permalink 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"
2024-08-22 23:59:16 +00:00
Loaded="OnLoaded"
SizeChanged="Page_SizeChanged">
2024-07-14 11:24:10 +00:00
2024-08-22 23:59:16 +00:00
<Grid x:Name="gridview">
<!-- Height="{Binding ElementName=NavigationViewControl, Path=CompactPaneLength}" -->
2024-07-14 11:24:10 +00:00
<Grid
x:Name="AppTitleBar"
2024-08-22 23:59:16 +00:00
Height="48"
2024-07-14 11:24:10 +00:00
VerticalAlignment="Top"
Canvas.ZIndex="1"
IsHitTestVisible="True">
2024-08-22 23:59:16 +00:00
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="IconColumn" Width="Auto" />
<ColumnDefinition x:Name="TitleColumn" Width="Auto" />
<ColumnDefinition
x:Name="RightDragColumn"
Width="*"
MinWidth="48" />
</Grid.ColumnDefinitions>
2024-07-14 11:24:10 +00:00
<Image
2024-08-22 23:59:16 +00:00
x:Name="TitleIcon"
Grid.Column="0"
2024-07-14 11:24:10 +00:00
Width="16"
Height="16"
2024-08-22 23:59:16 +00:00
Margin="0,0,6,0"
2024-07-14 11:24:10 +00:00
Source="/Assets/WindowIcon.ico" />
<TextBlock
x:Name="AppTitleBarText"
2024-08-22 23:59:16 +00:00
Grid.Column="1"
2024-07-14 11:24:10 +00:00
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
TextWrapping="NoWrap" />
2024-08-22 23:59:16 +00:00
<AutoSuggestBox
x:Name="TitleBarSearchBox"
Grid.Column="2"
MaxWidth="600"
Margin="6,0,150,0"
VerticalAlignment="Center"
PlaceholderText="搜索模组"
QueryIcon="Find"
QuerySubmitted="TitleBarSearchBox_QuerySubmitted" />
<!--<PersonPicture
x:Name="PersonPic"
Grid.Column="6"
Height="32"
Margin="0,0,16,0" />-->
2024-07-14 11:24:10 +00:00
</Grid>
<NavigationView
x:Name="NavigationViewControl"
DisplayModeChanged="NavigationViewControl_DisplayModeChanged"
ExpandedModeThresholdWidth="1280"
Header="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}"
2024-08-22 23:59:16 +00:00
IsBackButtonVisible="Auto"
2024-07-14 11:24:10 +00:00
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-08-19 14:30:11 +00:00
<NavigationViewItem
x:Uid="CodeTable"
helpers:NavigationHelper.NavigateTo="RustTools.ViewModels.CodeTableViewModel"
Tag="CodeTable">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE943;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem
x:Uid="CodeData"
helpers:NavigationHelper.NavigateTo="RustTools.ViewModels.CodeDataViewModel"
Tag="CodeTable">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE81E;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
2024-07-14 11:24:10 +00:00
</NavigationView.MenuItems>
2024-08-22 23:59:16 +00:00
<!--<NavigationView.HeaderTemplate>
2024-07-14 11:24:10 +00:00
<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>
2024-08-22 23:59:16 +00:00
</i:Interaction.Behaviors>-->
2024-07-14 11:24:10 +00:00
<Grid Margin="{StaticResource NavigationViewPageContentMargin}">
<Frame x:Name="NavigationFrame" />
</Grid>
</NavigationView>
</Grid>
</Page>