Class SfNavigationDrawer
Represents the SfNavigationDrawer control that contains multiple items that share the same space on the screen.
Inheritance
Implements
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.
<navigationdrawer:SfNavigationDrawer>
<navigationdrawer:SfNavigationDrawer.ContentView>
<StackLayout>
<Label Text = "Drawer Content" />
</StackLayout>
</navigationdrawer:SfNavigationDrawer.ContentView>
</navigationdrawer:SfNavigationDrawer>
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.
<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>
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.
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.
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> |