Skip to content
On this page

NavigationDrawer

Navigation drawers let people switch between UI views on larger devices.

  • Can be open or closed by default.
  • Two types: StandardNavigationDrawerStyle and ModalNavigationDrawerStyle.
  • Put the most frequent destinations at the top and group related destinations together.

Examples

xml
 <md:NavigationDrawer Style="{DynamicResource ModalNavigationDrawerStyle}">
     <Label
         Padding="20,0,20,20"
         FontAttributes="Bold"
         FontSize="18"
         Text="Title"
         TextColor="{DynamicResource OnSurfaceVariantColor}" />
     <md:NavigationDrawerItem IconData="{Static icon:Material.Category}" Text="Item 1">
         <Label
             FontSize="26"
             HorizontalOptions="Center"
             Text="Item 1"
             VerticalOptions="Center" />
     </md:NavigationDrawerItem>
     <md:NavigationDrawerItem IconData="{Static icon:Material.Category}" Text="Item 22">
         <Label
             FontSize="26"
             HorizontalOptions="Center"
             Text="Item 2"
             VerticalOptions="Center" />
     </md:NavigationDrawerItem>
     <md:NavigationDrawer.FooterItems>
         <md:NavigationDrawerItem IconData="{Static icon:Material.Settings}" Text="Settings">
             <Label
                 FontSize="26"
                 HorizontalOptions="Center"
                 Text="Settings"
                 VerticalOptions="Center" />
         </md:NavigationDrawerItem>
     </md:NavigationDrawer.FooterItems>
 </md:NavigationDrawer>
 
 ........................................................
 
 
  <md:NavigationDrawer Style="{DynamicResource StandardNavigationDrawerStyle}">
     <Label
         Padding="20,0,20,20"
         FontAttributes="Bold"
         FontSize="18"
         Text="Title"
         TextColor="{DynamicResource OnSurfaceVariantColor}" />
     <md:NavigationDrawerItem IconData="{Static icon:Material.Category}" Text="Item 1">
         <Label
             FontSize="26"
             HorizontalOptions="Center"
             Text="Item 1"
             VerticalOptions="Center" />
     </md:NavigationDrawerItem>
     <md:NavigationDrawerItem IconData="{Static icon:Material.Category}" Text="Item 22">
         <Label
             FontSize="26"
             HorizontalOptions="Center"
             Text="Item 2"
             VerticalOptions="Center" />
     </md:NavigationDrawerItem>
     <md:NavigationDrawer.FooterItems>
         <md:NavigationDrawerItem IconData="{Static icon:Material.Settings}" Text="Settings">
             <Label
                 FontSize="26"
                 HorizontalOptions="Center"
                 Text="Settings"
                 VerticalOptions="Center" />
         </md:NavigationDrawerItem>
     </md:NavigationDrawer.FooterItems>
 </md:NavigationDrawer>

Properties

nametypedefault
ItemsObservableCollection<View>
FooterItemsObservableCollection<View>
SelectedItemView
CommandICommand
CommandParameterobject

Events

nametype
SelectedItemChangedEventHandler<SelectedItemChangedArgs<NavigationDrawerItem>>
nametypedefault
ContentView
IsActivedboolfalse
Textstringempty
IconDatastringempty
IconColorColorOnSurfaceVariantColor
BackgroundColourColorTransparent
FontColorColorOnSurfaceVariantColor
FontSizefloat14
FontFamilystring
FontWeightFontWeightMedium
FontIsItalicboolfalse
ShapeShapefull
StateLayerColorColorOnSecondaryContainerColor
RippleDurationfloat0.5
RippleEasingEasingSinInOut
nametype
ClickedEventHandler<TouchEventArgs>
PressedEventHandler<TouchEventArgs>
ReleasedEventHandler<TouchEventArgs>
LongPressedEventHandler<TouchEventArgs>
RightClicked ( desktop only )EventHandler<TouchEventArgs>