Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

INavigation PopModalAsync() does not set modal page's Parent property to null

$
0
0

I have a modal page that I make appear and disappear by calling PushModalAsync(...) and PopModalAsync()

It's always worked for me, but today I updated to X.F 1.3.5.6335 and now I get an exception the second time I call PushModalAsync. I don't know if this new version of X.F started making this occur. I don't usually spam popping and pushing my modal pages but my QA person decided to test this today.

Here's the exception:
System.InvalidOperationException: Page must not already have a parent.

This exception is thrown by PushModalAsyc because after I call PopModalAsync the modal page's Parent property remains set to the App instance.

I don't explicitly set any of my app's page Parent properties and I'm not sure why this modal page's Parent is set to App. The modal page's Parent isn't immediately set to App after the initial call to PushModalAsync returns either. The inline documentation mentions that developers shouldn't really need set the Parent property, but now I need to set the Parent property of my modal page to null after using PopModalAsync in order to avoid this exception.

I can't find any mention of this change to INavigation functionality from Xamarin release notes or documentation. I don't see anyone else encountering this error yet either. Am I overlooking something obvious I need to do in addition to calling PopModalAsync() or is this a bug or intended INavigation behavior?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>