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

NullReferenceException setting ContentView

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?

Thanks.

1 Reply

RA Rachel A Syncfusion Team 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:
 
Android:
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.
 
 
Thanks, 
Rachel. 


Loader.
Live Chat Icon For mobile
Up arrow icon