-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathAppShell.xaml
More file actions
105 lines (96 loc) · 3.91 KB
/
AppShell.xaml
File metadata and controls
105 lines (96 loc) · 3.91 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="UTF-8" ?>
<simpleShell:SimpleShell
x:Class="Sample.SimpleShell.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:simpleShell="clr-namespace:SimpleToolkit.SimpleShell;assembly=SimpleToolkit.SimpleShell"
xmlns:pages="clr-namespace:Sample.SimpleShell.Views.Pages"
x:Name="thisShell"
Background="White">
<Tab
Title="Yellow-Green"
Route="YellowGreenTab">
<simpleShell:SimpleShell.ShellGroupContainerTemplate>
<DataTemplate
x:DataType="ShellSection">
<Grid
RowDefinitions="50, *">
<HorizontalStackLayout
Margin="20,5"
HorizontalOptions="Start" Spacing="10"
BindableLayout.ItemsSource="{Binding Items}">
<BindableLayout.ItemTemplate>
<DataTemplate
x:DataType="BaseShellItem">
<Button
Clicked="ShellItemButtonClicked"
Background="Black"
Text="{Binding Title}"/>
</DataTemplate>
</BindableLayout.ItemTemplate>
</HorizontalStackLayout>
<simpleShell:SimpleNavigationHost
Grid.Row="1"/>
</Grid>
</DataTemplate>
</simpleShell:SimpleShell.ShellGroupContainerTemplate>
<ShellContent
Title="Yellow"
ContentTemplate="{DataTemplate pages:YellowPage}"
Route="YellowPage"/>
<ShellContent
Title="Green"
ContentTemplate="{DataTemplate pages:GreenPage}"
Route="GreenPage"/>
</Tab>
<ShellContent
Title="Red"
ContentTemplate="{DataTemplate pages:RedPage}"
Route="RedPage"/>
<ShellContent
Title="Blue"
ContentTemplate="{DataTemplate pages:BluePage}"
Route="BluePage"/>
<simpleShell:SimpleShell.RootPageContainer>
<Grid
RowDefinitions="*, 50">
<simpleShell:SimpleNavigationHost/>
<HorizontalStackLayout
x:Name="tabBar"
Grid.Row="1"
Margin="20,5"
HorizontalOptions="Center" Spacing="10"
BindableLayout.ItemsSource="{Binding ShellSections, Source={x:Reference thisShell}, x:DataType={x:Type simpleShell:SimpleShell}}">
<BindableLayout.ItemTemplate>
<DataTemplate
x:DataType="BaseShellItem">
<Button
Clicked="ShellItemButtonClicked"
Background="Black"
Text="{Binding Title}"/>
</DataTemplate>
</BindableLayout.ItemTemplate>
</HorizontalStackLayout>
</Grid>
</simpleShell:SimpleShell.RootPageContainer>
<simpleShell:SimpleShell.Content>
<Grid
x:Name="rootContainer"
RowDefinitions="50, *">
<Button
x:Name="backButton"
Clicked="BackButtonClicked"
Text="Back"
Margin="20,5"
HorizontalOptions="Start"
Background="Black"/>
<Label
Margin="20,5"
HorizontalOptions="Center" VerticalOptions="Center"
Text="{Binding CurrentShellContent.Title, Source={x:Reference thisShell}, x:DataType={x:Type simpleShell:SimpleShell}}"
FontAttributes="Bold" FontSize="18"/>
<simpleShell:SimpleNavigationHost
Grid.Row="1"/>
</Grid>
</simpleShell:SimpleShell.Content>
</simpleShell:SimpleShell>