예제 #1
0
        protected override Windows.Foundation.Size MeasureOverride(Windows.Foundation.Size availableSize)
        {
            if (Element == null)
            {
                return(new Windows.Foundation.Size(0, 0));
            }

            double width  = Math.Max(0, Element.Width);
            double height = Math.Max(0, Element.Height);
            var    result = new Windows.Foundation.Size(width, height);

            Control?.Measure(result);

            return(result);
        }
예제 #2
0
        protected override Windows.Foundation.Size ArrangeOverride(Windows.Foundation.Size finalSize)
        {
            if (Element == null)
            {
                return(finalSize);
            }

            Element.IsInNativeLayout = true;

            Control?.Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height));

            Element.IsInNativeLayout = false;

            return(finalSize);
        }