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

NullReferenceException setting ContentView

Thread ID:





149220 Nov 19,2019 10:51 AM UTC Nov 20,2019 09:51 AM UTC Xamarin.Forms 1
Tags: SfNavigationDrawer
Asked On November 19, 2019 10:51 AM UTC

Hi everybody,

I keep getting a NullReferenceException when setting the ContentView property from a navigation drawer. In my case the ContentView has to be the Content of a ContentPage. I'm getting the reference to the Content of the page, instantiating it and then passing the Content property of the page to the ContentView property of the NavigationDrawer.

I tried getting rid of the ViewModel of the content page and it seems to be working but, as you know, I need. Does anyone experienced tha same issue? Is there any workaround?


Rachel A [Syncfusion]
Replied On November 20, 2019 09:51 AM UTC

Hi Marco,

Greetings from Syncfusion.

We have prepared the sample with different pages and have added the new page content to the NavigationDrawer ContentView on the initial page. Unfortunately, we could not reproduce the exception from our side. Please have the sample with which we have checked the issue.

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/NavigationDrawerMVVM-201435068
Device Details:
Moto G5
Android Version 9.0

iOS Simulator:
iPhone 11 - 13.0

Please check with the above sample and if the mentioned issue differs, please modify the sample with the issue reproducing steps which will be helpful for us to analyse further and provide an appropriate solution.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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
Live Chat Icon