Error when using .show() method.

Hello, an error is fired when I do popupLayout.Show(mainLayout);


The exception message is:

System.NullReferenceException: Object reference not set to an instance of an object.
  at Syncfusion.XForms.PopupLayout.SfPopupLayout.GetViewParentPage (Xamarin.Forms.View view) [0x0002a] in <d42f7f4028dc44ccaff50ec2d90c5369>:0 
  at Syncfusion.XForms.PopupLayout.SfPopupLayout.SetSfPopupLayoutAsContent (Xamarin.Forms.View rootView) [0x00000] in <d42f7f4028dc44ccaff50ec2d90c5369>:0 
  at Syncfusion.XForms.PopupLayout.SfPopupLayout.Show (Xamarin.Forms.View rootView) [0x00037] in <d42f7f4028dc44ccaff50ec2d90c5369>:0 
  at MemoApp.Views.DatosPacientes.BtnAceptar_Clicked (System.Object sender, System.EventArgs e) [0x0025b] 

I understand that the problem is when the app try to use the method GetViewParentPage() it returns null. 


Thank you very much.

1 Reply

SS Suhasini  Suresh Syncfusion Team March 19, 2018 03:45 AM UTC

Hi Uriel, 
 
Thanks for contacting Syncfusion Support. 
 
The above exception occurs since the root view is not passed correctly in the SfPopupLayout.Show(rootView) in the sample. 
 
We have prepared a sample using SfPopupLayout, you can download the same from the below link. 
 
 
Regards, 
Suhasini  


Loader.
Up arrow icon