public void InvalidateMeasure() { if (ShouldInterceptInvalidate) { return; } if (IsMeasureDirty) { return; // already dirty } SetLayoutFlags(LayoutFlag.MeasureDirty); if (FeatureConfiguration.UIElement.UseInvalidateMeasurePath && !IsMeasureDirtyPathDisabled) { InvalidateParentMeasureDirtyPath(); } else { (this.GetParent() as UIElement)?.InvalidateMeasure(); if (IsVisualTreeRoot) { #if __SKIA__ XamlRoot.InvalidateMeasure(); #else Window.InvalidateMeasure(); #endif } } }
internal void InvalidateParentMeasureDirtyPath() { if (this.GetParent() is UIElement parent) //TODO: Should this use VisualTree.GetParent as fallback? https://github.com/unoplatform/uno/issues/8978 { parent.InvalidateMeasureDirtyPath(); } else if (IsVisualTreeRoot) { #if __SKIA__ XamlRoot.InvalidateMeasure(); #else Window.InvalidateMeasure(); #endif } }