We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Navigate to a page in SfNavigationDrawer

Platform: Xamarin.Forms |
Control: SfNavigationDrawer

Syncfusion NavigationDrawer provides the feature of navigation from one page to another page.


To navigate from one page to another follow the below given procedure.


Step 1: Create the navigation drawer with all necessary assemblies.

Step 2: Enter the code in App.xaml.cs page as such. And also use the below given codes in the respective pages.


The below code illustrates how to navigate to another page.

Code behind code for main page:

namespace DrawerExample
public partial class MainPage : ContentPage
    public MainPage()
        SfNavigationDrawer navigationDrawer = new SfNavigationDrawer();
        Title = "Navigation Drawer";
        //Drawer content.
        Grid drawercontentlayout = new Grid();
        Label drawer = new Label();
        drawer.Text = "Drawer Content";
        drawer.FontSize = 14;
        drawer.TextColor = Color.Black;
        drawer.HorizontalTextAlignment = TextAlignment.Center;
        drawer.VerticalTextAlignment = TextAlignment.Center;
        navigationDrawer.DrawerContentView = drawercontentlayout;
        Grid headerLayout = new Grid();
        headerLayout.BackgroundColor = Color.FromHex("#1aa1d6");
        Label header = new Label();
        header.Text = "Header View";
        header.FontSize = 14;
        header.TextColor = Color.White;
        header.HorizontalTextAlignment = TextAlignment.Center;
        header.VerticalTextAlignment = TextAlignment.Center;
        header.BackgroundColor = Color.FromHex("#1aa1d6");
        navigationDrawer.DrawerHeaderView = headerLayout;
        Grid footerlayout = new Grid();
        footerlayout.BackgroundColor = Color.FromHex("#1aa1d6");
        Label footer = new Label();
        footer.Text = "Footer View";
        footer.FontSize = 14;
        footer.TextColor = Color.White;
        footer.HorizontalTextAlignment = TextAlignment.Center;
        footer.VerticalTextAlignment = TextAlignment.Center;
        footer.BackgroundColor = Color.FromHex("#1aa1d6");
        navigationDrawer.DrawerFooterView = footerlayout;
        navigationDrawer.Position = Position.Left;
        navigationDrawer.Transition = Transition.SlideOnTop;
        navigationDrawer.DrawerWidth = 200;
        navigationDrawer.DrawerHeaderHeight = 50;
        navigationDrawer.DrawerFooterHeight = 50;
        StackLayout stack = new StackLayout();
        Button bt = new Button();
        bt.Text = "Next_Page";
        bt.VerticalOptions = LayoutOptions.CenterAndExpand;
        bt.HorizontalOptions = LayoutOptions.CenterAndExpand;
        bt.Clicked += Bt_Clicked;
        navigationDrawer.ContentView = stack;
        this.Content = navigationDrawer;
    async void Bt_Clicked(object sender, System.EventArgs e)
        await Navigation.PushAsync(new NavigationPage2());

Navigation page XAML code:

<!--Navigation page content--> 
  <Label Text="Navigated Page" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" />       


In App.xaml.cs page. Use the following code:

public App()
MainPage = new NavigationPage(new DrawerExample.MainPage());


Main page with Opened:

Main page with Opened in SfNavigationDrawer

Navigated page:

Navigated page in SfNavigationDrawer




2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile