Skip to main content

DrawerView Class

The view that can show / hide a panel with navigation information and another data the end user may require (for example, account information).

Namespace: DevExpress.XamarinForms.Navigation

Assembly: DevExpress.XamarinForms.Navigation.dll

NuGet Package: DevExpress.XamarinForms.Navigation

Declaration

public class DrawerView :
    View,
    IDrawerControl

Remarks

This view consists of the following elements:

Drawer View: Elements

Refer to the Drawer View: Elements guide to learn more about Drawer View’s elements.

Example

The following example demonstrates how to configure the DrawerView’s basic properties.

<dxn:DrawerView
    x:Name="drawer"
    DrawerBehavior="SlideOnTop"
    DrawerPosition="Left"
    DrawerWidth="180"
    IsScrimEnabled="True"
    ScrimColor= "#80000000"
    IsDrawerShadowVisible="true"
    DrawerShadowHeight="1"
    DrawerShadowRadius="1"
    DrawerShadowColor="#808080">
    <dxn:DrawerView.DrawerHeaderContent>
        <view:DrawerHeader/>
    </dxn:DrawerView.DrawerHeaderContent>
    <dxn:DrawerView.DrawerFooterContent>
        <view:DrawerFooter/>
    </dxn:DrawerView.DrawerFooterContent>
    <dxn:DrawerView.DrawerContent>
        <ListView x:Name="categoryList"
                  ItemsSource="{Binding ItemsSource, Source={x:Reference self}}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <TextCell Text="{Binding GroupKey}" />
                </DataTemplate>
            </ListView.ItemTemplate>                    
        </ListView>
    </dxn:DrawerView.DrawerContent>
    <dxn:DrawerView.MainContent>
        <ListView BindingContext="{x:Reference categoryList}"
                  ItemsSource="{Binding SelectedItem.Vehicles}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <TextCell Text="{Binding FullName}"/>
                </DataTemplate>
            </ListView.ItemTemplate>                    
        </ListView>
    </dxn:DrawerView.MainContent>
</dxn:DrawerView>

The following table enumerates the properties the markup above uses and their descriptions.

Property

Description

DrawerBehavior

Gets or sets how the Drawer behaves on opening / closing.

DrawerContent

Gets or sets a view the DrawerView displays as the Drawer content.

DrawerHeaderContent

Gets or sets a view the DrawerView displays as the Drawer header.

DrawerFooterContent

Gets or sets a view the DrawerView displays as the Drawer footer.

MainContent

Gets or sets a view the DrawerView displays in the Main Area.

DrawerPosition

Gets or sets the edge out of which the Drawer moves out.

DrawerWidth

Gets or sets the width of the Drawer when DrawerPosition is set to Left or Right.

IsScrimEnabled

Gets or sets whether the view shows the Scrim when the Drawer is opened.

ScrimColor

Gets or sets the color the view uses to paint the Scrim.

IsDrawerShadowVisible

Gets or sets whether the Drawer’s shadow is visible.

DrawerShadowHeight

Gets or sets the height of the shadow the Drawer casts.

DrawerShadowRadius

Gets or sets the blur radius of the shadow the Drawer casts.

DrawerShadowColor

Gets or sets the color the view uses to paint the Drawer shadow.

DrawerContent

Gets or sets a view the DrawerView displays as the Drawer content.

DrawerHeaderContent

Gets or sets a view the DrawerView displays as the Drawer header.

DrawerFooterContent

Gets or sets a view the DrawerView displays as the Drawer footer.

Inheritance

Object
DrawerView
See Also