dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.99k stars 1.72k forks source link

Create Design Docs and Specs for how users should/can handle Handler Life Cycle #7381

Open PureWeen opened 2 years ago

PureWeen commented 2 years ago

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

pictos commented 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)

ghost commented 2 years ago

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.

thomasgalliker commented 1 week ago

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()

How can I consistently detect if a UI element (and with it the Handler instance) is no longer used?