-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
It has been 2 years since I've opened this bug, and MSFT didn't come up with a proper solution, so to save your precious time consider completely ditching MAUI Shell for now and use the following library (based on PRISM v8) to workaround this issue:
https://github.com/naveasy/Naveasy
It would be amazing if MAUI framework could call the
Dispose method on the Page and also on it's ViewModel when the page gets removed from the navigation stack so we developers can gracefully dispose object that we have used and will no longer be used.
It would be even better if the same could be done on custom controls (Views) that we create.
Steps to Reproduce
Implement IDisposable on a given page;
Also Implement IDisposable on it's page's VM
Current behavior
The Dispose() method is never called after we remove the page from the navigation stack.
Expected behavior:
Dispose() to be called when the page is removed from the navigation stack;
Version with bug
Release Candidate 2 on .NET 8
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)
Affected platform versions
Android 11 and iOS, Windows, Tizen, MacOS ...
Did you find any workaround?
No
Relevant log output
No response