|
1 |
| -<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 1 | +<FlyoutPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
3 | 3 | x:Class="DrawerViewExample.MainPage"
|
4 | 4 | xmlns:local="clr-namespace:DrawerViewExample"
|
5 |
| - xmlns:dxn="clr-namespace:DevExpress.Maui.Navigation;assembly=DevExpress.Maui.Navigation" |
| 5 | + |
| 6 | + FlyoutLayoutBehavior="{Binding IsLandscapeOriented, Source={x:Reference page}, |
| 7 | + Converter={StaticResource boolToDrawerBehaviorConverter}}" |
6 | 8 | x:Name="page">
|
7 |
| - <ContentPage.Resources> |
8 |
| - <local:BoolToDrawerBehaviorConverter x:Key="boolToDrawerBehaviorConverter"/> |
9 |
| - </ContentPage.Resources> |
10 |
| - <ContentPage.BindingContext> |
| 9 | + <FlyoutPage.BindingContext> |
11 | 10 | <local:MainViewModel/>
|
12 |
| - </ContentPage.BindingContext> |
13 |
| - <dxn:DrawerView x:Name="drawer" |
14 |
| - DrawerBehavior="{Binding IsLandscapeOriented, Source={x:Reference page}, |
15 |
| - Converter={StaticResource boolToDrawerBehaviorConverter}}" |
16 |
| - DrawerWidth="180" |
17 |
| - DrawerShadowHeight="10" |
18 |
| - DrawerShadowRadius="40" |
19 |
| - DrawerShadowColor="#808080" |
20 |
| - ScrimColor="#80000000"> |
21 |
| - <dxn:DrawerView.DrawerContent> |
22 |
| - <Grid HeightRequest="800"> |
23 |
| - <ListView x:Name="carBrandList" |
24 |
| - ItemsSource="{Binding CarModelsByBrand}"> |
25 |
| - <ListView.ItemTemplate> |
26 |
| - <DataTemplate> |
27 |
| - <ViewCell> |
28 |
| - <Label Padding="5" Text="{Binding BrandName}" /> |
29 |
| - </ViewCell> |
30 |
| - </DataTemplate> |
31 |
| - </ListView.ItemTemplate> |
32 |
| - </ListView> |
33 |
| - </Grid> |
34 |
| - </dxn:DrawerView.DrawerContent> |
35 |
| - <dxn:DrawerView.MainContent> |
36 |
| - <Grid HeightRequest="800"> |
37 |
| - <ListView BindingContext="{x:Reference carBrandList}" |
38 |
| - ItemsSource="{Binding SelectedItem.CarModels}"> |
39 |
| - <ListView.ItemTemplate> |
40 |
| - <DataTemplate> |
41 |
| - <ViewCell> |
42 |
| - <Label Padding="5" Text="{Binding FullName}" /> |
43 |
| - </ViewCell> |
| 11 | + </FlyoutPage.BindingContext> |
| 12 | + <FlyoutPage.Flyout> |
| 13 | + <ContentPage Title="About" IconImageSource="hamburger" WidthRequest="50"> |
| 14 | + <CollectionView x:Name="carBrandList" |
| 15 | + ItemsSource="{Binding CarModelsByBrand}" SelectionMode="Single"> |
| 16 | + <CollectionView.ItemTemplate> |
| 17 | + <DataTemplate> |
| 18 | + <Label Padding="5" Text="{Binding BrandName}" /> |
44 | 19 | </DataTemplate>
|
45 |
| - </ListView.ItemTemplate> |
46 |
| - </ListView> |
47 |
| - </Grid> |
48 |
| - </dxn:DrawerView.MainContent> |
49 |
| - </dxn:DrawerView> |
50 |
| -</ContentPage> |
| 20 | + </CollectionView.ItemTemplate> |
| 21 | + </CollectionView> |
| 22 | + </ContentPage> |
| 23 | + </FlyoutPage.Flyout> |
| 24 | + <FlyoutPage.Detail> |
| 25 | + <NavigationPage WidthRequest="50"> |
| 26 | + <x:Arguments> |
| 27 | + <ContentPage> |
| 28 | + <CollectionView BindingContext="{x:Reference carBrandList}" |
| 29 | + ItemsSource="{Binding SelectedItem.CarModels}"> |
| 30 | + <CollectionView.ItemTemplate> |
| 31 | + <DataTemplate> |
| 32 | + <Label Padding="5" Text="{Binding FullName}" /> |
| 33 | + </DataTemplate> |
| 34 | + </CollectionView.ItemTemplate> |
| 35 | + </CollectionView> |
| 36 | + </ContentPage> |
| 37 | + </x:Arguments> |
| 38 | + </NavigationPage> |
| 39 | + </FlyoutPage.Detail> |
| 40 | +</FlyoutPage> |
0 commit comments