menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class SfNavigationDrawer - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfNavigationDrawer

    Represents the SfNavigationDrawer control that contains multiple items that share the same space on the screen.

    Inheritance
    System.Object
    SfView
    Syncfusion.Maui.Toolkit.NavigationDrawer.SfNavigationDrawerExt
    SfNavigationDrawer
    Implements
    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<Microsoft.Maui.IView>
    System.Collections.Generic.ICollection<Microsoft.Maui.IView>
    System.Collections.Generic.IEnumerable<Microsoft.Maui.IView>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Inherited Members
    SfView.Children
    SfView.ClipToBounds
    SfView.Padding
    Namespace: Syncfusion.Maui.Toolkit.NavigationDrawer
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class SfNavigationDrawer : SfNavigationDrawerExt, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, ITouchListener, ITapGestureListener, IGestureListener, IParentThemeElement, IThemeElement

    Constructors

    SfNavigationDrawer()

    Initializes a new instance of the SfNavigationDrawer class.

    Declaration
    public SfNavigationDrawer()

    Fields

    ContentViewProperty

    Identifies the ContentView bindable property.

    Declaration
    public static readonly BindableProperty ContentViewProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    It is mandatory to set the ContentView property for the SfNavigationDrawer when initializing.

    DrawerSettingsProperty

    Identifies the DrawerSettings bindable property.

    Declaration
    public static readonly BindableProperty DrawerSettingsProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    FlowDirectionProperty

    Identifies the FlowDirection bindable property.

    Declaration
    public static readonly BindableProperty FlowDirectionProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    IsOpenProperty

    Identifies the IsOpen bindable property.

    Declaration
    public static readonly BindableProperty IsOpenProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    Properties

    ContentView

    Gets or sets the view that can be used to customize the content view of SfNavigationDrawer.

    Declaration
    public View ContentView { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.View

    It accepts ContentView values and the default value is null.

    Examples

    The below examples shows, how to use the ContentView property in the SfNavigationDrawer.

    • XAML
    • C#
    <navigationdrawer:SfNavigationDrawer>
    <navigationdrawer:SfNavigationDrawer.ContentView>
     <StackLayout>
       <Label Text = "Drawer Content" />
     </StackLayout>
    </navigationdrawer:SfNavigationDrawer.ContentView>
    </navigationdrawer:SfNavigationDrawer>
    var navigationDrawer = new SfNavigationDrawer
    {
        ContentView = new StackLayout
        {
            Children = 
            {
                new Label { Text = "Drawer Content" }
            }
        }
    };

    DrawerSettings

    Gets or sets the settings for the navigation drawer.

    Declaration
    public DrawerSettings DrawerSettings { get; set; }
    Property Value
    Type Description
    DrawerSettings

    It accepts DrawerSettings values and the default value is a new instance of DrawerSettings.

    Examples

    The below examples shows, how to use the DrawerSettings property in the SfNavigationDrawer.

    • XAML
    • C#
    <navigationdrawer:SfNavigationDrawer>
    <navigationdrawer:SfNavigationDrawer.DrawerSettings>
    <navigationdrawer:DrawerSettings DrawerWidth = "500" DrawerHeight="300">
       <navigationdrawer:DrawerSettings.DrawerHeaderView>
           <Label Text = "Header" />
       </navigationdrawer:DrawerSettings.DrawerHeaderView>
       <navigationdrawer:DrawerSettings.DrawerFooterView>
           <Label Text = "Footer" />
       </navigationdrawer:DrawerSettings.DrawerFooterView>
       <navigationdrawer:DrawerSettings.DrawerContentView>
           <Label Text = "Drawer Content" />
       </navigationdrawer:DrawerSettings.DrawerContentView>
       </navigationdrawer:DrawerSettings>
    </navigationdrawer:SfNavigationDrawer.DrawerSettings>
    </navigationdrawer:SfNavigationDrawer>
    var navigationDrawer = new SfNavigationDrawer
    {
        DrawerSettings = new DrawerSettings
        {
            DrawerWidth = 300,
            DrawerHeight = 500,
            DrawerHeaderView = new Label { Text = "Header" },
            DrawerContentView = new StackLayout
            {
                Children = 
                {
                    new Label { Text = "Drawer Content" }
                }
            },
            DrawerFooterView = new Label { Text = "Footer" }
        }
    };

    FlowDirection

    Gets or sets a value of the flow direction of the navigation drawer.

    Declaration
    public FlowDirection FlowDirection { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.FlowDirection

    It accepts FlowDirection values and the default value is Microsoft.Maui.FlowDirection.LeftToRight.

    Examples

    The below examples shows, how to use the FlowDirection property in the SfNavigationDrawer.

    • XAML
    • C#
    <navigationdrawer:SfNavigationDrawer FlowDirection="RightToLeft" />
    var navigationDrawer = new SfNavigationDrawer
    {
        FlowDirection = FlowDirection.RightToLeft
    };

    IsOpen

    Gets or sets a value indicating whether to open or close the drawer.

    Declaration
    public bool IsOpen { get; set; }
    Property Value
    Type Description
    System.Boolean

    It accepts IsOpen values and the default value is false.

    Examples

    The below examples shows, how to use the IsOpen property in the SfNavigationDrawer.

    • XAML
    • C#
    <navigationdrawer:SfNavigationDrawer IsOpen = "True" />
    var navigationDrawer = new SfNavigationDrawer
    {
        IsOpen = true
    };

    Methods

    ToggleDrawer()

    Methods to open or close the drawer based on the existing state in the SfNavigationDrawer.

    Declaration
    public void ToggleDrawer()
    Remarks

    This method enables to open or close the drawer programmatically based on the existing state in the SfNavigationDrawer.

    Examples
    private void HamburgerButton_Clicked(object sender, EventArgs e)
    {
        navigationDrawer.ToggleDrawer();
    }

    Events

    DrawerClosed

    It is drawer closed event.

    Declaration
    public event EventHandler<EventArgs> DrawerClosed
    Event Type
    Type
    System.EventHandler<System.EventArgs>

    DrawerClosing

    It is drawer closing event.

    Declaration
    public event EventHandler<CancelEventArgs> DrawerClosing
    Event Type
    Type
    System.EventHandler<System.ComponentModel.CancelEventArgs>

    DrawerOpened

    It is drawer opened event.

    Declaration
    public event EventHandler<EventArgs> DrawerOpened
    Event Type
    Type
    System.EventHandler<System.EventArgs>

    DrawerOpening

    It is drawer opening event.

    Declaration
    public event EventHandler<CancelEventArgs> DrawerOpening
    Event Type
    Type
    System.EventHandler<System.ComponentModel.CancelEventArgs>

    DrawerToggled

    It is drawer toggled event.

    Declaration
    public event EventHandler<ToggledEventArgs> DrawerToggled
    Event Type
    Type
    System.EventHandler<ToggledEventArgs>

    Implements

    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<>
    System.Collections.Generic.ICollection<>
    System.Collections.Generic.IEnumerable<>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.ICrossPlatformLayout
    Microsoft.Maui.IVisualTreeElement
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved