Open PureWeen opened 2 years ago
@PureWeen how about implementing a reference counter? If I'm not wrong Comet has this implemented. If that's a simple implementation we can add this to .NET MAUI and call the DisconnectHandler
when we don't have any more references at all. (If this idea is doable I can create a discussion to centralize the info)
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
It would be valueable if someone could give guidance on how and when to call DisconnectHandler()
. I maintain some MAUI library and I feel like this topic is an unsolved problem.
How can I in a library project automatically call DisconnectHandler()
MainPage = new NavigationPage(new MainPage())
)MainPage = new AppShell()
)How can I consistently detect if a UI element (and with it the Handler instance) is no longer used?
Provide better guidance for what users can do currently and create specs to plan for the future
Existing issues and conversations
https://github.com/dotnet/maui/issues/3604 https://github.com/dotnet/maui/issues/7354 https://github.com/dotnet/maui/pull/7349#discussion_r878484367