コード例 #1
0
        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();
                }
            }
        }
コード例 #2
0
 internal void InvalidateParentMeasurePath()
 {
     if (this.GetParent() is UIElement parent)
     {
         parent.InvalidateMeasurePath();
     }
     else if (IsVisualTreeRoot)
     {
         Window.InvalidateMeasure();
     }
 }
コード例 #3
0
 public void InvalidateArrange()
 {
     if (_isArrangeValid)
     {
         _isArrangeValid = false;
         if (this.GetParent() is UIElement parent)
         {
             parent.InvalidateArrange();
         }
         else
         {
             Window.InvalidateMeasure();
         }
     }
 }
コード例 #4
0
        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
            }
        }
コード例 #5
0
 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();
         }
     }
 }
コード例 #6
0
        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
        }