Fix syncing modal stack when the window is created/recreated
Description of Change
Fix ModalNavigationManager so it will reprocess the current Modal stack when the root window handler changes. Currently we aren't processing any modal pages pushed before the app has loaded and we don't reprocess the modal stack if the window is destroyed and recreated (Android).
This PR adds code to detect when we need to reprocess the modal stack based on the root view changing or being destroyed
Breaking Changes
- On Window if a lifecycle event is called at a place in time that doesn't make sense, we will now throw an exception. https://github.com/dotnet/maui/pull/13025/files#diff-07d5a2c0b5069d448623e88d890e41bc2c21e12f99bd01f1349903a332d4130cR475-R519
Issues Fixed
Fixes #8157
:warning: Your code has been reformatted. :warning:
🚨 Breaking change detected @davidbritch FYI
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.