BililiveRecorder/BililiveRecorder.WPF/Pages/RootPage.xaml
2022-06-11 16:34:47 +08:00

158 lines
10 KiB
XML

<UserControl
x:Class="BililiveRecorder.WPF.Pages.RootPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:m="clr-namespace:BililiveRecorder.WPF.Models"
xmlns:l="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
l:LocalizeDictionary.DesignCulture=""
l:ResxLocalizationProvider.DefaultAssembly="BililiveRecorder.WPF"
l:ResxLocalizationProvider.DefaultDictionary="Strings"
xmlns:local="clr-namespace:BililiveRecorder.WPF.Pages"
xmlns:wpf="clr-namespace:BililiveRecorder.WPF"
xmlns:controls="clr-namespace:BililiveRecorder.WPF.Controls"
xmlns:models="clr-namespace:BililiveRecorder.WPF.Models"
mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="600"
d:DataContext="{d:DesignInstance Type=models:RootModel,IsDesignTimeCreatable=True}"
Background="{DynamicResource SystemControlPageBackgroundAltHighBrush}">
<UserControl.Resources>
<Style x:Key="CascadeDataContextFrame" TargetType="{x:Type ui:Frame}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ui:Frame}">
<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
ClipToBounds="True"
Padding="{TemplateBinding Padding}">
<Grid>
<ContentPresenter
x:Name="FirstContentPresenter"
Content="{x:Null}"
DataContext="{TemplateBinding DataContext}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<ContentPresenter
x:Name="SecondContentPresenter"
Content="{x:Null}"
DataContext="{TemplateBinding DataContext}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<controls:TaskbarIconControl DataContext="{Binding}" d:IsHidden="True"/>
<ui:NavigationView IsBackEnabled="False" IsBackButtonVisible="Collapsed"
IsSettingsVisible="False" ExpandedModeThresholdWidth="1115"
IsPaneOpen="False" OpenPaneLength="200"
SelectionChanged="NavigationView_SelectionChanged">
<ui:NavigationView.PaneCustomContent>
<StackPanel>
<Menu>
<MenuItem>
<MenuItem.Header>
<ui:PathIcon Width="16" Height="16" Style="{StaticResource PathIconDataTranslate}"/>
</MenuItem.Header>
<MenuItem Header="简体中文" CommandParameter="" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="繁體中文" CommandParameter="zh-Hant" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="日本語" CommandParameter="ja" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="English" CommandParameter="en" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="喵ニャーMeow🐱🐈" x:Name="JokeLangSelectionMenuItem" CommandParameter="en-PN" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<Separator/>
<MenuItem Header="参与翻译" Command="{x:Static m:Commands.OpenLink}" CommandParameter="https://rec.danmuji.org/link/translate/">
<MenuItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataOpenInNew}"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>
<Menu>
<MenuItem Click="SwitchLightDarkTheme_Click">
<MenuItem.Header>
<ui:PathIcon Width="16" Height="16" Style="{StaticResource PathIconDataThemeLightDark}"/>
</MenuItem.Header>
</MenuItem>
</Menu>
</StackPanel>
</ui:NavigationView.PaneCustomContent>
<ui:NavigationView.PaneFooter>
<Grid Width="40" Height="40" x:Name="DebugBuildIcon" Visibility="Collapsed" HorizontalAlignment="Left">
<ui:PathIcon Width="24" Height="24" ToolTip="Debug Build 测试版"
Style="{StaticResource PathIconDataBugOutline}"/>
</Grid>
</ui:NavigationView.PaneFooter>
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem Content="{l:Loc RootPage_NavigationViewItem_AnnouncementPage}" Tag="AnnouncementPage" IsSelected="True">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataBullhornOutline}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{l:Loc RootPage_NavigationViewItem_RoomListPage}" Tag="RoomListPage" IsEnabled="False" x:Name="RoomListPageNavigationViewItem">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataHomeOutline}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{l:Loc Toolbox_Title}" SelectsOnInvoked="False">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataToolboxOutline}"/>
</ui:NavigationViewItem.Icon>
<ui:NavigationViewItem.MenuItems>
<ui:NavigationViewItem l:ResxLocalizationProvider.DefaultDictionary="Strings"
Content="{l:Loc Toolbox_AutoFix_Title}" Tag="ToolboxAutoFixPage">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataAutoFix}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem l:ResxLocalizationProvider.DefaultDictionary="Strings"
Content="{l:Loc Toolbox_Remux_Title}" Tag="ToolboxRemuxPage">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataAlphaRCircleOutline}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem l:ResxLocalizationProvider.DefaultDictionary="Strings"
Content="{l:Loc Toolbox_Merge_Title}" Tag="ToolboxDanmakuMergerPage">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataMerge}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationViewItem.MenuItems>
</ui:NavigationViewItem>
</ui:NavigationView.MenuItems>
<ui:NavigationView.FooterMenuItems>
<ui:NavigationViewItem Content="{l:Loc RootPage_NavigationViewItem_AdvancedSettingsPage}" Tag="AdvancedSettingsPage" x:Name="AdvancedSettingsPageItem">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataCogs}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{l:Loc RootPage_NavigationViewItem_SettingsPage}" Tag="SettingsPage"
IsEnabled="False"
x:Name="SettingsPageNavigationViewItem"
MouseRightButtonUp="NavigationViewItem_MouseRightButtonUp">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataCogOutline}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{l:Loc RootPage_NavigationViewItem_LogPage}" Tag="LogPage">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataPaperRollOutline}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{l:Loc About_Title}" Tag="AboutPage">
<ui:NavigationViewItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataInformationOutline}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationView.FooterMenuItems>
<ui:Frame x:Name="MainFrame" Style="{DynamicResource CascadeDataContextFrame}" Navigated="MainFrame_Navigated" />
</ui:NavigationView>
</Grid>
</UserControl>