private void KnobsPanel_PointerMoved(object?sender, Input.PointerEventArgs e)
        {
            if (_knobsPanelPressed)
            {
                var difference = e.GetPosition(_switchKnob) - _switchStartPoint;

                if ((!_isDragging) && (System.Math.Abs(difference.X) > 3))
                {
                    _isDragging = true;
                    PseudoClasses.Set(":dragging", true);
                }

                if (_isDragging)
                {
                    Canvas.SetLeft(_knobsPanel !, System.Math.Min(_switchKnob !.Bounds.Width, System.Math.Max(0, (_initLeft + difference.X))));
                }
            }
        }
Exemple #2
0
        private void ResizeFromRight(Input.PointerEventArgs e)
        {
            Point  pos = e.GetPosition(this);
            double w   = pos.X;

            if (w < 80)
            {
                w           = double.NaN;
                IsMaximized = false;
            }
            else
            {
                IsMaximized = true;
            }

            if (double.IsNaN(MaxWidth) == false && w > MaxWidth)
            {
                w = MaxWidth;
            }

            Width = w;
        }
        private void ResizeFromLeft(Input.PointerEventArgs e)
        {
            Point  pos = e.GetPosition(this);
            double w   = this.Width - pos.X;

            if (w < 80)
            {
                w           = double.NaN;
                IsMaximized = false;
            }
            else
            {
                IsMaximized = true;
            }

            if (MaxWidth != double.NaN && w > MaxWidth)
            {
                w = MaxWidth;
            }

            Width = w;
        }