SuRGeoNix/Flyleaf

WPF FlyleafHost: Load/Unload should be symmetrical

Opened this issue · 1 comments

WPF components can get loaded and unloaded for many reasons, like PC going into sleep, disconnecting a RDP connection, moving a loaded component to another parent or window. They therefore need to have a symmetrical load/unload event so it can get reloaded and unloaded.

In some circumstances (like moving the flyleaf host from one window to the main window) the host will get disposed, but the component will load again. This creates an unusable host which does not have an overlay or surface to render to.

I've been working on a version of the FlyleafHost which has symmetrical load events.
Do you want me to make a PR of that version or should I just keep it in my local code as a custom host in order to not break API (removing IDisposable) with the FlyleafHost @SuRGeoNix?

@coldays As far as it doesn't break the functionality feel free to make a PR. Don't worry about the API if that improves the control. However, I'm still focusing on the backend for v4 so no promises for a quick review.