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 create SfNavigationDrawer sample in code behind

Platform: Xamarin.Forms |
Control: SfNavigationDrawer

We can create SfNavigationDrawer sample in the code behind. By using the below code the user can use the SfNavigationDrawer without XAML code.


To create SfNavigationDrawer in code behind follow the below given procedure:


Step 1: Add the necessary assemblies in the PCL, Android, iOS and UWP project. Click the link to know more about the assemblies required for adding SfNavigationDrawer to your project.


Step 2: Use the below code snippet in the code behind of your sample and run the project.


The below code illustrate the way to create a SfNavigationDrawer without XAML Code.


C# code to create SfNavigationDrawer


















2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment
Billy Panopio
Nov 25, 2017

Could you provide me an example of sfnavigationdrawer using mvvm prism with at least 2 navigation links? I tried creating contentview but for some reason I cant wire my viewmodel into it. Thanks!

Jerry Faust
Mar 18, 2018

Hello.  Using this code, I seem to have a focus problem.  After the drawer slides out, my clicks do not appear to go to the ListView, and do not trigger the ListView ItemSelected event. It works fine in the emulator, but not on a device.  Any thoughts?  Thanks.

Jerry Faust
Mar 18, 2018

I should note that if I simply remove the RowDefinition, it works from the start, except that the height is no longer set to 40, and instead takes up half the screen.

Vanaja  Annasamy [Syncfusion]
Mar 20, 2018

Hi Jerry,

We have provided the NavigationDrawer sample in the below link. Please run the sample and check whether the issue reproduces at your end. 

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/NavigationDrawer-2103165920.zip

If the issue persists, revert with more details on the reproduction steps to help us to provide a better solution.


Vanaja R.A

Oct 26, 2018


When I place textbox, autocomplete in the conentview of navigation drawer, the virtual keyboard gets hidden.

When i click the textbox or autocomple the keyboard pops out and hides immediately.


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