How to clean up event subscriptions added in a PlatformBehavior.OnAttachedTo #22976
Unanswered
DanTravison
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my PlatformBehavior.OnAttachedTo, I'm subscribing to events on Window.Content but I cannot figure out how to remove these event subscribers.
I 'thought' that I could do it in PlatformBehavior.OnDetactedFrom but the bindable.Window.Handler has already been removed.
The docs indicate that OnDetachingFrom can be overridden but this is incorrect, since the method is sealed (?!).
I'm attaching the behavior to a ContentPage, in one case, the main page, in another a secondary page.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions