VerticalTabControlLib.DragAdorner.SetOffset C# (CSharp) Method

SetOffset() public method

public SetOffset ( double x, double y ) : void
x double
y double
return void
        public void SetOffset(double x, double y)
        {
            Debug.WriteLine($"OffsetX:{OffsetX},OffsetY:{OffsetY}");
            Debug.WriteLine($"x:{x},y:{y}");
            Debug.WriteLine($"StartX:{StartPosition.X},StartY:{StartPosition.Y}");
            OffsetX = x - StartPosition.X;
            OffsetY = y - StartPosition.Y;

            // update
            var layer = Parent as AdornerLayer;
            layer?.Update(AdornedElement);
        }

Usage Example

Exemplo n.º 1
0
        protected override void OnPreviewDragOver(DragEventArgs e)
        {
            base.OnPreviewDragOver(e);

            //Debug.WriteLine("PreviewDragOver");

            var currentPosition = PointToScreen(e.GetPosition(this));

            _dragAdorner.SetOffset(currentPosition.X, currentPosition.Y);
        }
All Usage Examples Of VerticalTabControlLib.DragAdorner::SetOffset