Class SfNavigationDrawer
Represents the SfNavigationDrawer control that contains multiple items that share the same space on the screen.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Maui.NavigationDrawer
Assembly: Syncfusion.Maui.NavigationDrawer.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 | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for ContentView bindable property. |
DrawerSettingsProperty
Identifies the DrawerSettings bindable property.
Declaration
public static readonly BindableProperty DrawerSettingsProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for DrawerSettings bindable property. |
EnableLiquidGlassEffectProperty
Identifies the EnableLiquidGlassEffect bindable property.
Declaration
public static readonly BindableProperty EnableLiquidGlassEffectProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for EnableLiquidGlassEffect bindable property. |
FlowDirectionProperty
Identifies the FlowDirection bindable property.
Declaration
public static readonly BindableProperty FlowDirectionProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for FlowDirection bindable property. |
SecondaryDrawerSettingsProperty
Identifies the SecondaryDrawerSettings bindable property.
Declaration
public static readonly BindableProperty SecondaryDrawerSettingsProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for SecondaryDrawerSettings bindable property. |
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 |
|---|
| Microsoft.Maui.Controls.View |
DrawerSettings
Gets or sets the DrawerSettings," which is a container for various customization options, allowing the appearance of the navigation drawer to be customized.
Declaration
public DrawerSettings DrawerSettings { get; set; }
Property Value
| Type |
|---|
| DrawerSettings |
EnableLiquidGlassEffect
Gets or sets a value indicating whether the liquid glass effect is enabled for the view.
Declaration
public bool EnableLiquidGlassEffect { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | It accepts bool values, and the default value is False. |
Remarks
This effect is supported only on macOS and iOS platforms.
Examples
using Syncfusion.Maui.NavigationDrawer;
// Create the navigation drawer
var drawer = new SfNavigationDrawer();
// Enable only on supported Apple platforms
#if IOS || MACCATALYST
drawer.EnableLiquidGlassEffect = true;
#else
drawer.EnableLiquidGlassEffect = false;
#endif
<syncfusion:SfNavigationDrawer
EnableLiquidGlassEffect="{OnPlatform iOS=true, MacCatalyst=true, Default=false}">
<!-- Drawer content here -->
</syncfusion:SfNavigationDrawer>
FlowDirection
Gets or sets a value of the flow direction of the navigation drawer.
Declaration
public FlowDirection FlowDirection { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.FlowDirection |
SecondaryDrawerSettings
Gets or sets the SecondaryDrawerSettings, which is a container for various customization options for the secondary drawer, allowing its appearance to be customized.
Declaration
public DrawerSettings SecondaryDrawerSettings { get; set; }
Property Value
| Type |
|---|
| DrawerSettings |
Methods
OnBindingContextChanged()
Call when the binding context is changed.
Declaration
protected override void OnBindingContextChanged()
Overrides
OnHandlerChanged()
Raised when handler gets changed.
Declaration
protected override void OnHandlerChanged()
Overrides
OnPropertyChanged(String)
Raised when a property value changes.
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | propertyName |
OnSizeAllocated(Double, Double)
OnSizeAllocated method.
Declaration
protected override void OnSizeAllocated(double width, double height)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | width | Width. |
| System.Double | height | Height. |
ToggleDrawer()
Methods to open or close the drawer based on the existing state in the SfNavigationDrawer.
Declaration
public void ToggleDrawer()
ToggleSecondaryDrawer()
Methods to open or close the secondary drawer based on the existing state in the SfNavigationDrawer.
Declaration
public void ToggleSecondaryDrawer()
Events
DrawerClosed
It is drawer closed event.
Declaration
public event EventHandler<DrawerEventArgs> DrawerClosed
Event Type
| Type |
|---|
| System.EventHandler<DrawerEventArgs> |
DrawerClosing
It is drawer closing event.
Declaration
public event EventHandler<DrawerCancelEventArgs> DrawerClosing
Event Type
| Type |
|---|
| System.EventHandler<DrawerCancelEventArgs> |
DrawerOpened
It is drawer opened event.
Declaration
public event EventHandler<DrawerEventArgs> DrawerOpened
Event Type
| Type |
|---|
| System.EventHandler<DrawerEventArgs> |
DrawerOpening
It is drawer opening event.
Declaration
public event EventHandler<DrawerCancelEventArgs> DrawerOpening
Event Type
| Type |
|---|
| System.EventHandler<DrawerCancelEventArgs> |
DrawerToggled
It is drawer toggled event.
Declaration
public event EventHandler<ToggledEventArgs> DrawerToggled
Event Type
| Type |
|---|
| System.EventHandler<ToggledEventArgs> |