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?
Use the
LayoutUpdatedevent to run any code when the layout updates. Use a bool set to true onSizeChangedand then set to false again before you do anything to make sure you don’t cause a loop!