|
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | +<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 4 | + x:Class="MauiDrawer.MainPage" |
| 5 | + xmlns:local="clr-namespace:MauiDrawer" |
| 6 | + xmlns:navigationdrawer="clr-namespace:Syncfusion.Maui.NavigationDrawer;assembly=Syncfusion.Maui.NavigationDrawer"> |
| 7 | + |
| 8 | + <ContentPage.BindingContext> |
| 9 | + <local:MainPageViewModel/> |
| 10 | + </ContentPage.BindingContext> |
| 11 | + |
| 12 | + <navigationdrawer:SfNavigationDrawer x:Name="navigationDrawer" IsOpen="{Binding IsDrawerOpen,Mode=TwoWay}"> |
| 13 | + <navigationdrawer:SfNavigationDrawer.DrawerSettings> |
| 14 | + <navigationdrawer:DrawerSettings DrawerWidth="230" DrawerHeaderHeight="150" > |
| 15 | + <navigationdrawer:DrawerSettings.DrawerHeaderView> |
| 16 | + <Grid BackgroundColor="#6750A4" RowDefinitions="120,40"> |
| 17 | + <Image Source="user.png" |
| 18 | + HeightRequest="110" |
| 19 | + Margin="0,10,0,0" |
| 20 | + BackgroundColor="#6750A4" |
| 21 | + VerticalOptions="Center" |
| 22 | + HorizontalOptions="Center"/> |
| 23 | + <Label Text="James Pollock" |
| 24 | + Grid.Row="1" |
| 25 | + HorizontalTextAlignment="Center" |
| 26 | + HorizontalOptions="Center" |
| 27 | + FontSize="20" |
| 28 | + TextColor="White"/> |
| 29 | + </Grid> |
| 30 | + </navigationdrawer:DrawerSettings.DrawerHeaderView> |
| 31 | + <navigationdrawer:DrawerSettings.DrawerContentView> |
| 32 | + <VerticalStackLayout x:Name="drawerContentView" Spacing="10" HorizontalOptions="Center" Margin="20"> |
| 33 | + <ListView x:Name="listView" |
| 34 | + ItemSelected="listView_ItemSelected"> |
| 35 | + <ListView.ItemTemplate> |
| 36 | + <DataTemplate> |
| 37 | + <ViewCell> |
| 38 | + <VerticalStackLayout HeightRequest="40"> |
| 39 | + <Label Margin="10,7,0,0" |
| 40 | + Text="{Binding}" |
| 41 | + FontSize="16" |
| 42 | + TextColor="Black"/> |
| 43 | + </VerticalStackLayout> |
| 44 | + </ViewCell> |
| 45 | + </DataTemplate> |
| 46 | + </ListView.ItemTemplate> |
| 47 | + </ListView> |
| 48 | + </VerticalStackLayout> |
| 49 | + </navigationdrawer:DrawerSettings.DrawerContentView> |
| 50 | + </navigationdrawer:DrawerSettings> |
| 51 | + </navigationdrawer:SfNavigationDrawer.DrawerSettings> |
| 52 | + <navigationdrawer:SfNavigationDrawer.ContentView> |
| 53 | + <Grid x:Name="mainContentView" |
| 54 | + BackgroundColor="White" RowDefinitions="Auto,*"> |
| 55 | + <HorizontalStackLayout BackgroundColor="#6750A4" Spacing="10" Padding="5,0,0,0"> |
| 56 | + <ImageButton x:Name="hamburgerButton" |
| 57 | + HeightRequest="50" |
| 58 | + WidthRequest="50" |
| 59 | + HorizontalOptions="Start" |
| 60 | + Source="hamburgericon.png" |
| 61 | + BackgroundColor="#6750A4" |
| 62 | + Command="{Binding ToggleDrawerCommand}"/> |
| 63 | + <Label x:Name="headerLabel" |
| 64 | + HeightRequest="50" |
| 65 | + HorizontalTextAlignment="Center" |
| 66 | + VerticalTextAlignment="Center" |
| 67 | + Text="Home" FontSize="16" |
| 68 | + TextColor="White" |
| 69 | + BackgroundColor="#6750A4"/> |
| 70 | + </HorizontalStackLayout> |
| 71 | + <Label Grid.Row="1" |
| 72 | + x:Name="contentLabel" |
| 73 | + VerticalOptions="Center" |
| 74 | + HorizontalOptions="Center" |
| 75 | + Text="Home" |
| 76 | + FontSize="14" |
| 77 | + TextColor="Black"/> |
| 78 | + </Grid> |
| 79 | + </navigationdrawer:SfNavigationDrawer.ContentView> |
| 80 | + </navigationdrawer:SfNavigationDrawer> |
| 81 | + |
| 82 | +</ContentPage> |
0 commit comments