-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.xaml
40 lines (39 loc) · 1.81 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
<FlyoutPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DrawerViewExample.MainPage"
xmlns:local="clr-namespace:DrawerViewExample"
FlyoutLayoutBehavior="{Binding IsLandscapeOriented, Source={x:Reference page},
Converter={StaticResource boolToDrawerBehaviorConverter}}"
x:Name="page">
<FlyoutPage.BindingContext>
<local:MainViewModel/>
</FlyoutPage.BindingContext>
<FlyoutPage.Flyout>
<ContentPage Title="About" IconImageSource="hamburger" WidthRequest="50">
<CollectionView x:Name="carBrandList"
ItemsSource="{Binding CarModelsByBrand}" SelectionMode="Single">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Padding="5" Text="{Binding BrandName}" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentPage>
</FlyoutPage.Flyout>
<FlyoutPage.Detail>
<NavigationPage WidthRequest="50">
<x:Arguments>
<ContentPage>
<CollectionView BindingContext="{x:Reference carBrandList}"
ItemsSource="{Binding SelectedItem.CarModels}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Padding="5" Text="{Binding FullName}" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentPage>
</x:Arguments>
</NavigationPage>
</FlyoutPage.Detail>
</FlyoutPage>