-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.xaml
78 lines (72 loc) · 3.09 KB
/
MainPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<Page
x:Class="vba.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:vba"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Custom="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid x:Name="G1">
<Grid.Resources>
<!-- AcrylicBrush - 亮色 -->
<AcrylicBrush
x:Key="AcrylicBrushLight"
BackgroundSource="HostBackdrop"
TintColor="White"
TintOpacity="0.6"
FallbackColor="LightGray"/>
<!-- AcrylicBrush - 暗色 -->
<AcrylicBrush
x:Key="AcrylicBrushDark"
BackgroundSource="HostBackdrop"
TintColor="Black"
TintOpacity="0.6"
FallbackColor="DarkGray"/>
</Grid.Resources>
<Grid.RowDefinitions>
<!-- 自定义标题栏高度 -->
<RowDefinition Height="48"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 自定义标题栏 -->
<Grid x:Name="CustomTitleBar" Background="Transparent">
<Grid.ColumnDefinitions>
<!-- 留空,用于自适应系统按钮的留白 -->
<ColumnDefinition x:Name="LeftPaddingColumn" Width="0"/>
<ColumnDefinition/>
<ColumnDefinition x:Name="RightPaddingColumn" Width="0"/>
</Grid.ColumnDefinitions>
<Image Source="Assets/StoreLogo.png"
Grid.Column="1"
HorizontalAlignment="Left"
Width="16" Height="16"
Margin="16,0,0,0"/>
<TextBlock x:Name="AppTitleTextBlock"
Text="零度UWP工具箱"
Style="{StaticResource CaptionTextBlockStyle}"
Grid.Column="1"
VerticalAlignment="Center"
Margin="40,0,0,0"/>
</Grid>
<!-- NavigationView -->
<Custom:NavigationView
x:Name="NavView"
Grid.Row="1"
IsPaneOpen="True"
SelectionChanged="NavView_SelectionChanged"
Loaded="NavView_Loaded"
PaneDisplayMode="Top"
IsSettingsVisible="False"
BackRequested="NavView_BackRequested"
IsTitleBarAutoPaddingEnabled ="False">
<Custom:NavigationView.MenuItems>
<Custom:NavigationViewItem Icon="Home" Content="主页" Tag="HomePage" />
<Custom:NavigationViewItem Icon="ForWard" Content="关于" Tag="AboutPage"/>
<Custom:NavigationViewItem Icon="Setting" Content="设置" Tag="SettingsPage"/>
</Custom:NavigationView.MenuItems>
<Frame x:Name="contentFrame" Navigated="contentFrame_Navigated"/>
</Custom:NavigationView>
</Grid>
</Page>