Reputation: 9645
I've got a Grid
that resizes when the app is snapped. It has to update an animation based on the new ActualWidth
of an element. However, when I tie this function to the SizeChanged
event, it seems to fire before the snapped view is redrawn, and calculates the previous ActualWidth
.
How do I ensure that my function runs AFTER the app is redrawn post-snap?
Upvotes: 1
Views: 1136
Reputation: 9645
Use the LayoutUpdated
event to run any code when the layout updates. Use a bool set to true on SizeChanged
and then set to false again before you do anything to make sure you don't cause a loop!
Upvotes: 1