InvalidateScrollInfo() public method

public InvalidateScrollInfo ( ) : void
return void
コード例 #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();
            }
        }
コード例 #2
0
ファイル: Diagram.cs プロジェクト: sujithvj/wpf-demos
 private void SetViewport(Size size)
 {
     if (_viewport != size)
     {
         _viewport = size;
         if (_owner != null)
         {
             _owner.InvalidateScrollInfo();
         }
     }
 }
コード例 #3
0
        void SetOffset(double?x = null, double?y = null)
        {
            var offset = this.contentOffset;

            if (x.HasValue)
            {
                offset.X = x.Value;
            }
            if (y.HasValue)
            {
                offset.Y = y.Value;
            }

            // Clamp horizontal
            if (offset.X < 0 || this.viewport.Width >= this.extent.Width)
            {
                offset.X = 0;
            }
            else if (offset.X + this.viewport.Width >= this.extent.Width)
            {
                offset.X = this.extent.Width - this.viewport.Width;
            }

            // Clamp vertical
            if (offset.Y < 0 || this.viewport.Height >= this.extent.Height)
            {
                offset.Y = 0;
            }
            else if (offset.Y + this.viewport.Height >= this.extent.Height)
            {
                offset.Y = this.extent.Height - this.viewport.Height;
            }

            if (offset != this.contentOffset)
            {
                this.contentOffset = offset;
                if (usingCustomScrolling)
                {
                    this.horizontalBackend.SetOffset(offset.X);
                    this.verticalBackend.SetOffset(offset.Y);
                }
                else
                {
                    this.transform.X = -offset.X;
                    this.transform.Y = -offset.Y;
                }
                if (ScrollOwner != null)
                {
                    ScrollOwner.InvalidateScrollInfo();
                }
            }
        }
コード例 #4
0
ファイル: Stack.cs プロジェクト: beda2280/wpf-1
 // OnScrollChange is an override called whenever the IScrollInfo exposed scrolling state changes on this element.
 // At the time this method is called, scrolling state is in its new, valid state.
 private void OnScrollChange()
 {
     if (ScrollOwner != null)
     {
         ScrollOwner.InvalidateScrollInfo();
     }
 }