Exception when PopUp close in Shell Navigation

Hey guys,

I am using Syncfusion to develop a Xamarin forms app and more particulary the SfPopUplayout. I create an app with a shell navigation with four pages. All the pages have this structure in XAML:


<ContentPage>
     <ContentPage.Content>
               <popuplayout:SfPopupLayout>
            <popuplayout:SfPopupLayout.PopupView>
                <popuplayout:PopupView>
                    <popuplayout:PopupView.ContentTemplate>
                        <DataTemplate>
                              // Content of the popview

                         </DataTemplate>
                    </popuplayout:PopupView.ContentTemplate>
                    <popuplayout:PopupView.PopupStyle>
                        <popuplayout:PopupStyle
                            BorderThickness="0"
                            OverlayColor="#2B4552"
                            OverlayOpacity="0.8" />
                    </popuplayout:PopupView.PopupStyle>
                </popuplayout:PopupView>

            </popuplayout:SfPopupLayout.PopupView>
         
            <popuplayout:SfPopupLayout.Content>
          // Content of the page without the popup
          </popuplayout:SfPopupLayout.Content>


 I use the SfPopupLayout to create a tutorial with a popup with a small opacity and with overlay view like this.

When I close the popup on my third or fourth page and i try to continue to use the app normally this Exception appears. I try to close the popup with PopUp.IsOpen = false, PopUp.Dismiss(), PopUp.Dispose(), and it's the same so ... I don't understand, someone have an idea please ? 

System.NotSupportedException: Unable to activate instance of type Syncfusion.XForms.Android.PopupLayout.PopupView from native handle



6 Replies 1 reply marked as answer

SS Sivaraman Sivagurunathan Syncfusion Team October 30, 2020 05:43 AM UTC

Hi Elise, 

Thanks for using Syncfusion controls. 

We have checked your query and attached code snippet and prepared the sample based on your code snippet. Unfortunately we are unable to reproduce the reported issue from our side. It is working fine as expected. Crash does not occurs. We have test the issue with Oneplus device with Android 10. We have test the issue in XF version 4.8.0.1560 and SfPopupLayout version 18.3.0.44.  We have attached tested sample for your reference. You can download the same from the below link. If the issue still occurs from your side please revert us with modified sample with SfPopupLayout product version, Xamarin.Forms version and device details. It will help us to provide the better solution.       


Regards,   
Sivaraman S   



EJ Elise Joffre November 5, 2020 03:10 PM UTC

Hi,

I tried to make an example project with the bug. When you close the popup at the fourth page and continue to use the app normally, the app freezes .. you can't naviguate anymore ... so what can we do for this ?

Thanks 

The procject is too large so i give you a weetransfer link : https://we.tl/t-HI0TiKT6AZ


SS Sivaraman Sivagurunathan Syncfusion Team November 6, 2020 12:11 PM UTC

Hi Elise, 

Thanks for your update. 

We have checked your attached sample and we are able to reproduce the reported app freezes issue in our side. Currently we are validate the reported issue from our side. we will check and let you know the details on or before 10th November 2020. We appreciate your patience until then. 

Regards,
Sivaraman S 



KK Karthikraja Kalaimani Syncfusion Team November 10, 2020 12:18 PM UTC

Hi Elise,

Thank you for your patience.

We have checked the reported issue and we found that you have immediately navigated to another page before the popup is completely get closed. Since the zoom animation mode requires 200ms time to complete the animation. So, you can navigate to another page on closed event of the popupview. Please refer to the below code snippet.

Code snippet :

 
// HomePage
      private void Button_Clicked(object sender, EventArgs e) 
        { 
            AppShell.Instance.IsTutorialActive = true; 
            popup.IsOpen = true; 
            popup.Closed += Popup_Closed; 
 
 
        } 
 
        private async void Popup_Closed(object sender, EventArgs e) 
        { 
            await Shell.Current.GoToAsync("//secondePage"); 
        } 
 
        private async void Page2(object sender, EventArgs e) 
        { 
            popup.IsOpen = false; 
 
        }
//ExamplePage
 
protected override void OnAppearing() 
        { 
            base.OnAppearing(); 
 
            if (AppShell.Instance.IsTutorialActive) 
            { 
                popup.IsOpen = true; 
                popup.Closed += Popup_Closed; 
            } 
        } 
 
        private async void Popup_Closed(object sender, System.EventArgs e) 
        { 
            await Shell.Current.GoToAsync("//thirdPage"); 
        } 
 
        private async void Button_Clicked(object sender, System.EventArgs e) 
        { 
            popup.IsOpen = false; 
 
        }
//thirdView
  protected override void OnAppearing() 
        { 
            base.OnAppearing(); 
 
            if (AppShell.Instance.IsTutorialActive) 
            { 
                popup.IsOpen = true; 
                popup.Closed += Popup_Closed; 
            } 
        } 
 
        private async void Popup_Closed(object sender, EventArgs e) 
        { 
            // throw new NotImplementedException(); 
            AppShell.Instance.IsTutorialActive = false; 
            await Shell.Current.GoToAsync("//fourthPage"); 
        } 
 
        private async void Button_Clicked(object sender, EventArgs e) 
        { 
            popup.IsOpen = false; 
   
 
        }
//FourthView
  
private void Button_Clicked(object sender, EventArgs e) 
        { 
            AppShell.Instance.IsTutorialActive = true; 
            popup.IsOpen = true; 
        } 

Regards,
Karthik Raja


Marked as answer

EJ Elise Joffre November 15, 2020 10:03 AM UTC

It works very well ! Thank you for your efficiency and speed ! :) 

Regards,



GS Gokul Saravanan Syncfusion Team November 16, 2020 10:58 AM UTC

Hi Elise, 
Thanks for update. We are happy that the mentioned issue has been resolved at your end.  
Regards, 
Gokul S 


Loader.
Up arrow icon