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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create SfNavigationDrawer sample in code behind

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

 

 

 

DrawerContentView

 

 

 

 

 

 

 

 

MainContentView

 

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8020 10/03/2017 11/10/2017 Xamarin.Forms SfNavigationDrawer
Did you find this information helpful?
Comments
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!

Reply
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.

Reply
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.


Regards,

Vanaja R.A

Reply
Mercy Oct 26, 2018

Hi

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.

Reply
Add Comment
You must log in to leave a comment

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