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
close icon

NullReferenceException on UWP SfNavigationDrawer ToggleDrawer

since update 17.2.0.36 I sometimes get a NullReferenceException on SfNavigationDrawer.ToggleDrawer in UWP
I can't reproduce when I try, it happenes randomly, I didn't saw a reason

   at Syncfusion.UI.Xaml.NavigationDrawer.SfNavigationDrawer.GetSlideOnTopAnimations()
   at Syncfusion.UI.Xaml.NavigationDrawer.SfNavigationDrawer.GetAnimations()
   at Syncfusion.UI.Xaml.NavigationDrawer.SfNavigationDrawer.OpenDrawer()
   at Syncfusion.UI.Xaml.NavigationDrawer.SfNavigationDrawer.OnIsOpenChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Syncfusion.SfNavigationDrawer.XForms.UWP.SfNavigationDrawerMapping.OnNavigationDrawerPropertiesChanged(String propertyName, SfNavigationDrawer formsNavigationDrawer, SfNavigationDrawer nativenavigationDrawer)
   at Syncfusion.SfNavigationDrawer.XForms.UWP.SfNavigationDrawerRenderer.OnElementPropertyChanged(Object sender, PropertyChangedEventArgs e)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at Xamarin.Forms.BindableObject.OnPropertyChanged(String propertyName)
   at Xamarin.Forms.Element.OnPropertyChanged(String propertyName)
   at Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent)
   at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes)
   at Xamarin.Forms.BindableObject.SetValue(BindableProperty property, Object value, Boolean fromStyle, Boolean checkAccess)
   at Syncfusion.SfNavigationDrawer.XForms.UWP.SfNavigationDrawerRenderer.NativeNavigationDrawer_Opening(Object sender, CancelEventArgs e)
   at Syncfusion.UI.Xaml.NavigationDrawer.SfNavigationDrawer.OnIsOpenChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Syncfusion.UI.Xaml.NavigationDrawer.SfNavigationDrawer.ToggleDrawer()
   at Syncfusion.SfNavigationDrawer.XForms.WinPhone.Mapping.ToggleDrawer_Windows.Syncfusion.SfNavigationDrawer.XForms.IToggleDrawer.ToggleDrawer(SfNavigationDrawer formsDrawer)
   at Syncfusion.SfNavigationDrawer.XForms.SfNavigationDrawer.ToggleDrawer()

why there is no Show and Hide action for SfNavigationDrawer.?
regards

9 Replies

MK Muneesh Kumar G Syncfusion Team July 29, 2019 12:41 PM UTC

Hi Ma, 
  
Query 1: Show and Hide action for SfNavigationDrawer. 
 
We have analyzed your requirement in SfNavigationDrawer. Please use the IsOpen property for drawer show or hide action in SfNavigationDrawer. 
 
 Query 2: NullReferenceException on SfNavigationDrawer.ToggleDrawer in UWP. 
 
We have fixed the reported crash in SfNavigationDrawer with your stack trace. Please download the patch from the following location.  
  
Please find the patch setup from below location: 
http://syncfusion.com/Installs/support/patch/17.2.0.34/1160553/F146252/SyncfusionPatch_17.2.0.34_1160553_7292019065835178_F146252.exe 
 
Please find the patch assemblies alone from below location: 
http://syncfusion.com/Installs/support/patch/17.2.0.34/1160553/F146252/SyncfusionPatch_17.2.0.34_1160553_7292019065835178_F146252.zip 
  
Please find the NuGet from below location: 
http://syncfusion.com/Installs/support/patch/17.2.0.34/1160553/F146252/SyncfusionNuget_17.2.0.34_1160553_7292019065835178_F146252.zip 
  
Assembly Version: 17.2.0.34 
  
Please verify this patch with your application and let us know whether your issue has been resolved or not, so that we can able to include this fix in our release.  
 
Thanks, 
Muneesh Kumar G. 



MA ma July 30, 2019 02:14 AM UTC

since I created this Thread it didn't happen again ;-)
as soon it happenes again I'll install the patch

is there a way to force this error?


MK Muneesh Kumar G Syncfusion Team July 30, 2019 07:17 AM UTC

Hi Ma, 
 
Thanks for your update.  
 
As we said in our previous update, we have fixed this problem only with your stactrace. So, once you confirmed the fix resolves your problem, we will include the fix in our next release.  
  
Thanks,   
Muneesh Kumar G.   
 



MA ma July 31, 2019 12:49 AM UTC

I got the error again, see ScreenShot attached

I only updated UWP-Project
PCL-Project is on Version 17.2.0.36

regards

Attachment: sfNaviDraw_452aec7c.zip


MK Muneesh Kumar G Syncfusion Team July 31, 2019 12:57 PM UTC

Hi Ma,  
 
We suspect that the fix has not been applied in your application correctly. This problem occurs due the nuget cache has not been cleared correctly in your system. Please follow steps mentioned in below link before applying the patch.  
  
  
If you still face the problem, please updates us the sample based on your application along with replication procedure. This will be helpful for us to investigate further and provide you a better solution at the earliest. 
 
Also, we would like to inform you that, we must use same version in all the project in solution. We can’t use fix version in one project and another version in PCL project.  
 
Thanks,   
Muneesh Kumar G.   
 



MA ma July 31, 2019 06:56 PM UTC

I found it:

create an App with several pages (MasterDetail in my Case) and add a SfNavigationDrawer to one Page
select the Page and open and close the Drawer
select another Page and execute Application.Current.Resources = new ResourceDictionary();
secelt the Page with the Drawer again (the same Instance!) and toggle the Drawer => Error will occoures

regards


MK Muneesh Kumar G Syncfusion Team August 1, 2019 12:49 PM UTC

Hi Ma,  
 
We have analyzed the reported issue “When navigate the page and load SfNavigationDrawer, while open the drawer null reference exception occurred” in our side and we didn't face the reported issue. We have prepared the sample for your reference.  
 
Please check the below attached sample and video from below link. Can you please provide the sample for replicate this issue? 
 
Sample Link: 
 
Video Link: 
 
Thanks,   
Muneesh Kumar G.   
 



MA ma August 5, 2019 11:25 PM UTC

hi,

here a sample project so produce the error:

switch to the page with the Drawer and klick the Button at the Bottom to toggle the Drawer
switch back to Browser-Page
klick the Theme-Button at the top of menu-page
switch to the page with the Drawer and klick the Button at the Bottom to toggle the Drawer

if you open the Drawer by sliding no error occourcs
it is enoug to execute Application.Current.Resources res = new ResourceDictionary(); instead of changing the theme

regards

Attachment: NavigationDrawerTest2_4b561c30.zip


MK Muneesh Kumar G Syncfusion Team August 6, 2019 09:08 AM UTC

Hi Ma, 
 
We have fixed the reported crash in SfNavigationDrawer with given sample. Please download the patch from the following location.  
  
Please find the patch setup from below location: 
http://syncfusion.com/Installs/support/patch/17.2.0.34/1160553/F146252/SyncfusionPatch_17.2.0.34_1160553_8062019033445659_F146252.exe 
 
Please find the patch assemblies alone from below location: 
http://syncfusion.com/Installs/support/patch/17.2.0.34/1160553/F146252/SyncfusionPatch_17.2.0.34_1160553_8062019033445659_F146252.zip 
   
Please find the NuGet from below location: 
http://syncfusion.com/Installs/support/patch/17.2.0.34/1160553/F146252/SyncfusionNuget_17.2.0.34_1160553_8062019033445659_F146252.zip 
   
Assembly Version: 17.2.0.34 
   
Disclaimer: 
Please note that we have created this patch for version 17.2.0.34 specifically to resolve the following issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.  
 
This fix will be included in our upcoming Volume 2 SP1 release. Which will be available on mid of August 2019.  
 
Thanks, 
Muneesh Kumar G. 


Loader.
Live Chat Icon For mobile
Up arrow icon