I have a custom Panel which upon resizing has its LayoutUpdated event and ArrangeOverride called twice.
So initially MeasureOverride and ArrangeOverride do their thing once upon open of the client window. Then, if I maximize the window each are called twice. The Available and Final Sizes respectively are not different between each iteration so I'm not sure what's initiating this.
Is there a way to determine the cause of the Invalidation?
I think that it is called twice because the Height and Width changes. I think that both of those properties affect Measure and thus there is a layout pass for each one.
Is there a way to determine the cause of the Invalidation?
Invalidation usually is caused by a change of a DependencyProperty which among it's FrameworkPropertyMetadataOptions has flags AffectsMeasure/AffectsOverride.
As Pavel already said - it's likely that invalidation fires for both changes in Width and Height.
Anyway, you shouldn't rely on the number of those invalidations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With