Ejemplo n.º 1
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            // 滚动区域相关逻辑
            _scrollExtent          = finalSize;
            _canHorizontallyScroll = ExtentWidth > ViewportWidth;
            _canVerticallyScroll   = ExtentHeight > ViewportHeight;
            _scrollOffset.X        = CommonUtilities.Clamp(_scrollOffset.X, 0.0, ExtentWidth - ViewportWidth);
            _scrollOffset.Y        = CommonUtilities.Clamp(_scrollOffset.Y, 0.0, ExtentHeight - ViewportHeight);
            if (ScrollOwner != null)
            {
                ScrollOwner.InvalidateScrollInfo();
            }

            base.InvalidateVisual();

            return(base.ArrangeOverride(finalSize));
        }