public void InvalidateMeasure() { if (ShouldInterceptInvalidate) { return; } if (IsMeasureDirty) { return; // already dirty } SetLayoutFlags(LayoutFlag.MeasureDirty); if (FeatureConfiguration.UIElement.UseInvalidateMeasurePath && !IsMeasureDirtyPathDisabled) { InvalidateParentMeasurePath(); } else { (this.GetParent() as UIElement)?.InvalidateMeasure(); if (IsVisualTreeRoot) { Window.InvalidateMeasure(); } } }
internal void InvalidateParentMeasurePath() { if (this.GetParent() is UIElement parent) { parent.InvalidateMeasurePath(); } else if (IsVisualTreeRoot) { Window.InvalidateMeasure(); } }
public void InvalidateArrange() { if (_isArrangeValid) { _isArrangeValid = false; if (this.GetParent() is UIElement parent) { parent.InvalidateArrange(); } else { Window.InvalidateMeasure(); } } }
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 } }
public void InvalidateMeasure() { // TODO: Figure out why this condition breaks layouting in some cases //if (_isMeasureValid) { _isMeasureValid = false; _isArrangeValid = false; if (this.GetParent() is UIElement parent) { parent.InvalidateMeasure(); } else { Window.InvalidateMeasure(); } } }
public static void InvalidateMeasure(this IFrameworkElement e) { #if XAMARIN_ANDROID var UnoViewGroup = e as UnoViewGroup; if (UnoViewGroup != null) { // Use a non-virtual version of the RequestLayout method, for performance. UnoViewGroup.RequestLayout(); } else { (e as View).RequestLayout(); } #elif XAMARIN_IOS (e as View).SetNeedsLayout(); #elif __WASM__ Window.InvalidateMeasure(); #endif }