/
M3MaterialCommandBarSample_NestedPage1.xaml
70 lines (62 loc) · 2.85 KB
/
M3MaterialCommandBarSample_NestedPage1.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
<Page x:Class="Uno.Themes.Samples.Content.NestedSamples.M3MaterialCommandBarSample_NestedPage1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Uno.Themes.Samples.Content.NestedSamples"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="using:Uno.UI.Toolkit"
xmlns:smtx="using:ShowMeTheXAML"
xmlns:todo="what should be done"
xmlns:xamarin="http://uno.ui/xamarin"
mc:Ignorable="d todo xamarin"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<CommandBar Content="Material Page 1"
toolkit:VisibleBoundsPadding.PaddingMask="Top"
Style="{StaticResource M3MaterialCommandBarStyle}">
<toolkit:CommandBarExtensions.NavigationCommand>
<AppBarButton Click="NavigateBack"
Style="{StaticResource M3MaterialAppBarButtonStyle}">
<AppBarButton.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/BackButton.png" />
</AppBarButton.Icon>
</AppBarButton>
</toolkit:CommandBarExtensions.NavigationCommand>
</CommandBar>
<StackPanel Grid.Row="1"
Margin="16">
<TextBlock Style="{StaticResource M3MaterialBodySmall}">
You can use the back button located on the left side of the CommandBar
to exit this sample.
</TextBlock>
<Button Content="Exit sample"
Click="NavigateBack" />
<Button Content="Navigate to next page"
Click="NavigateToNextPage" />
<smtx:XamlPresenter ReferenceKey="MaterialM3_CommandBarSample_NestedPage1_CommandBar" />
<Button x:Name="SeeCodeBehindButton"
Tag="See code behind"
Style="{StaticResource SeeSourceFlyoutButtonStyle}" />
<TextBlock Style="{StaticResource M3MaterialBodySmall}">
note: In order for the `M3MaterialCommandBarStyle` to work properly on iOS and Android,
you will need to present them using a `NativeDefaultFrame` in your MainPage/Shell. As shown below:
</TextBlock>
<smtx:XamlDisplay UniqueKey="MaterialM3_CommandBarSample_NestedPage1_Note"
Style="{StaticResource SourceOnlyXamlDisplayStyle}">
<Frame x:Name="ContentFrame"
xamarin:Style="{StaticResource NativeDefaultFrame}" />
</smtx:XamlDisplay>
<TextBlock Style="{StaticResource M3MaterialBodySmall}">
note: In order to support native back navigations (uwp, browser, android),
you will have to handle the SystemNavigationManager.BackRequested event. As shown below:
</TextBlock>
<Button x:Name="SeeAdditionSetupButton"
Tag="See additional setup"
Style="{StaticResource SeeSourceFlyoutButtonStyle}" />
</StackPanel>
</Grid>
</Page>