.LayoutUpdated fired although FrameworkElement no longer is part of the visual tree?!? (not an UNO issue though) #18825
Unanswered
DierkDroth
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Thanks for the report. As far as I can tell, some of those events may still be raised even if the element is not in the tree, particularly if the event was scheduled to be raised when the item was still in the tree. You may want to handle those scenarios using the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Well, just another day where I learnt something new ... I guess.
So far may layman thinking was, that FrameworkElement events would not be fired after the element was removed from the visual tree, in particular .LayoutUpdated would not be fired
Appears, my understanding was wrong. Please check out attached repo and run the WinUI3 head:
MainPage_LayoutUpdated
method and resize the app window ->.LayoutUpdated
still is firedMinimal.9.zip
This also leaves the question if the button eventually would be garbage collected at all or not?!?
Now I wonder, if I'm doing something wrong with my repo or if my understand was incomplete so far. Any feedback would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions