System.Windows.Controls.ScrollViewer.InvalidateScrollInfo C# (CSharp) Method

InvalidateScrollInfo() public method

public InvalidateScrollInfo ( ) : void
return void
        public void InvalidateScrollInfo ()
        {
            if (ScrollInfo != null) {
                ExtentHeight = ScrollInfo.ExtentHeight;
                ExtentWidth = ScrollInfo.ExtentWidth;
                ViewportHeight = ScrollInfo.ViewportHeight;
                ViewportWidth = ScrollInfo.ViewportWidth;
                UpdateScrollBar (Orientation.Horizontal, ScrollInfo.HorizontalOffset);
                UpdateScrollBar (Orientation.Vertical, ScrollInfo.VerticalOffset);
                UpdateScrollbarVisibility ();
            }
            // UIA Event
            RaiseViewportChangedEvent (ViewportWidth, ViewportHeight);
            if (Math.Max(0, ExtentHeight - ViewportHeight) != ScrollableHeight) {
                SetValueImpl (ScrollableHeightProperty, Math.Max(0, ExtentHeight - ViewportHeight));
                InvalidateMeasure ();
            }
            if (Math.Max(0, ExtentWidth - ViewportWidth) != ScrollableWidth) {
                SetValueImpl (ScrollableWidthProperty, Math.Max(0, ExtentWidth - ViewportWidth));
                InvalidateMeasure ();
            }
        }
        

Usage Example

コード例 #1
0
        public void SetHorizontalOffset(double offset)
        {
            if (offset < 0 || this.viewport.Width >= this.extent.Width)
            {
                offset = 0;
            }
            else if (offset + this.viewport.Width >= this.extent.Width)
            {
                offset = this.extent.Width - this.viewport.Width;
            }

            this.contentOffset.X = offset;
            if (usingCustomScrolling)
            {
                this.horizontalBackend.SetOffset(offset);
            }
            else
            {
                this.transform.X = -offset;
            }
            if (ScrollOwner != null)
            {
                ScrollOwner.InvalidateScrollInfo();
            }
        }
All Usage Examples Of System.Windows.Controls.ScrollViewer::InvalidateScrollInfo