-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShellPage.xaml
80 lines (78 loc) · 3.87 KB
/
ShellPage.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
79
80
<Page
x:Class="T41_UI.Views.ShellPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:helpers="using:T41_UI.Helpers"
xmlns:behaviors="using:T41_UI.Behaviors"
xmlns:i="using:Microsoft.Xaml.Interactivity"
Loaded="OnLoaded">
<Grid>
<Grid x:Name="AppTitleBar"
Canvas.ZIndex="1"
Height="{Binding ElementName=NavigationViewControl, Path=CompactPaneLength}"
IsHitTestVisible="True"
VerticalAlignment="Top">
<Image Source="/Assets/WindowIcon.ico"
HorizontalAlignment="Left"
Width="16"
Height="16" />
<TextBlock x:Name="AppTitleBarText"
VerticalAlignment="Center"
TextWrapping="NoWrap"
Style="{StaticResource CaptionTextBlockStyle}"
Margin="28,0,0,0"/>
</Grid>
<NavigationView
x:Name="NavigationViewControl"
Canvas.ZIndex="0"
IsBackButtonVisible="Visible"
IsBackEnabled="{x:Bind ViewModel.IsBackEnabled, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}"
IsSettingsVisible="False"
ExpandedModeThresholdWidth="1280"
DisplayModeChanged="NavigationViewControl_DisplayModeChanged"
Header="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}">
<NavigationView.MenuItems>
<!--
TODO: Update item titles by updating <x:Uid>.Content entries in Strings/en-us/Resources.resw.
https://docs.microsoft.com/windows/uwp/app-resources/localize-strings-ui-manifest#refer-to-a-string-resource-identifier-from-xaml
TODO: Update item icons by updating FontIcon.Glyph properties.
https://docs.microsoft.com/windows/apps/design/style/segoe-fluent-icons-font#icon-list
-->
<NavigationViewItem x:Uid="Shell_Main" helpers:NavigationHelper.NavigateTo="T41_UI.ViewModels.MainViewModel">
<NavigationViewItem.Icon>
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
</NavigationViewItem.Icon>
</NavigationViewItem>
</NavigationView.MenuItems>
<NavigationView.HeaderTemplate>
<DataTemplate>
<Grid>
<TextBlock
Text="{Binding}"
Style="{ThemeResource TitleTextBlockStyle}" />
</Grid>
</DataTemplate>
</NavigationView.HeaderTemplate>
<i:Interaction.Behaviors>
<behaviors:NavigationViewHeaderBehavior
DefaultHeader="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}">
<behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
<DataTemplate>
<Grid>
<TextBlock
Text="{Binding}"
Style="{ThemeResource TitleTextBlockStyle}" />
</Grid>
</DataTemplate>
</behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
</behaviors:NavigationViewHeaderBehavior>
</i:Interaction.Behaviors>
<Grid Margin="{StaticResource NavigationViewPageContentMargin}">
<Frame x:Name="NavigationFrame" />
</Grid>
</NavigationView>
</Grid>
</Page>