コード例 #1
0
 private void MaxThumb_DragCompleted(object sender, DragCompletedEventArgs e)
 {
     UpdateMaxThumb(RangeMax);
     Canvas.SetZIndex(MinThumb, 0);
     Canvas.SetZIndex(MaxThumb, 10);
     DragCompleted?.Invoke(this, EventArgs.Empty);
 }
コード例 #2
0
ファイル: Slider.cs プロジェクト: zhoulihe1981/Xamarin.Forms
 void ISliderController.SendDragCompleted()
 {
     if (IsEnabled)
     {
         DragCompletedCommand?.Execute(null);
         DragCompleted?.Invoke(this, null);
     }
 }
コード例 #3
0
 void ISlider.DragCompleted()
 {
     if (IsEnabled)
     {
         DragCompletedCommand?.Execute(null);
         DragCompleted?.Invoke();
     }
 }
コード例 #4
0
 void SendDragCompleted()
 {
     if (IsEnabled)
     {
         DragCompletedCommand?.Execute(null);
         DragCompleted?.Invoke(this, null);
     }
 }
コード例 #5
0
ファイル: Thumb.Android.cs プロジェクト: propellingbits/Uno
 private void CompleteDrag(double x, double y)
 {
     IsDragging = false;
     DragCompleted?.Invoke(
         this,
         new DragCompletedEventArgs(
             ViewHelper.PhysicalToLogicalPixels(x - _startX),
             ViewHelper.PhysicalToLogicalPixels(y - _startY)
             , false
             )
         );
 }
コード例 #6
0
        private void CeaseDragging(bool isCancellation)
        {
            ;
            if (isCaptured)
            {
                isCaptured = false;
                Mouse.Capture(this, CaptureMode.None);
                ReleaseMouseCapture();

                var currentPosition = GetMousePosition();
                DragCompleted?.Invoke(this, new DragCompletedEventArgs(currentPosition.X - startPosition.X, currentPosition.Y - startPosition.Y, isCancellation));
            }
        }
コード例 #7
0
        private void CanvasView_Touch(object sender, SKTouchEventArgs e)
        {
            if (e.ActionType == SKTouchAction.Entered || e.ActionType == SKTouchAction.Pressed)
            {
                DragStarted?.Invoke(this, new EventArgs());
            }
            if (e.ActionType == SKTouchAction.Exited || e.ActionType == SKTouchAction.Released)
            {
                DragCompleted?.Invoke(this, new EventArgs());
            }
            var   dis            = GetDistance(Center.X, e.Location.X, Center.Y, e.Location.Y);
            float adjustedRadius = (MinorAxisLength / 2) - arcPadding;

            if (dis < (adjustedRadius + KnobRadius))
            {
                var angle = (float)(GetAngle(Center.X, e.Location.X, Center.Y, e.Location.Y) + 120) % 360;
                //Debug.WriteLine($"Angle:{angle % 360}");

                float sweepAngle = (startAngle + angle) % 360; // the current endpoint of  the draw arc
                                                               //Debug.WriteLine($"sweepAngle:{sweepAngle }");
                var sweepPercent = sweepAngle / 300;
                // Debug.WriteLine($"sweepPercent:{sweepPercent}");
                double newValue;
                if (Min < 0)
                {
                    newValue = ((Max - Min) * sweepPercent) + Min;
                }
                else
                {
                    newValue = ((Max - Min) * sweepPercent) + Min;
                }

                if (newValue <= Max)
                {
                    Value = Math.Round(newValue, Precision);
                }
                else if (sweepAngle < 320)
                {
                    Value = Max;
                }
                else if (sweepAngle > 340)
                {
                    Value = Min;
                }
            }
            e.Handled = true;
        }
コード例 #8
0
        public override void EndTracking(UITouch uitouch, UIEvent uievent)
        {
            _lowerHandle.Highlighted = false;
            _upperHandle.Highlighted = false;

            if (StepValue > 0)
            {
                _stepValueInternal = StepValue;

                SetLowerValue(LowerValue, true);
                SetUpperValue(UpperValue, true);
            }

            SendActionForControlEvents(UIControlEvent.ValueChanged);

            DragCompleted?.Invoke(this, EventArgs.Empty);
        }
コード例 #9
0
 /// <summary>
 ///     This is called when the user either releases his touch or the touch is canceled.
 /// </summary>
 private void OnStopTrackingTouch()
 {
     _isDragging = false;
     DragCompleted?.Invoke(this, EventArgs.Empty);
 }
コード例 #10
0
 protected void RaiseDRCompleted(object sender, DragCompletedEventArgs dragCompletedEventArgs)
 {
     DragCompleted?.Invoke(this, dragCompletedEventArgs);
 }
コード例 #11
0
 public void OnDragCompleted()
 {
     DragCompleted?.Invoke(this, EventArgs.Empty);
 }
コード例 #12
0
 protected override void OnThumbDragCompleted(DragCompletedEventArgs e)
 {
     base.OnThumbDragCompleted(e);
     DragCompleted?.Invoke(this, e);
 }
コード例 #13
0
 public override void OrganiseOnDragCompleted(DragablzItemsControl requestor, Size measureBounds, IEnumerable <DragablzItem> siblingItems, DragablzItem dragItem)
 {
     DragCompleted?.Invoke();
     base.OrganiseOnDragCompleted(requestor, measureBounds, siblingItems, dragItem);
 }
コード例 #14
0
 internal void CompleteDrag(Point location)
 {
     IsDragging = false;
     DragCompleted?.Invoke(this, new DragCompletedEventArgs(location.X - _startLocation.X, location.Y - _startLocation.Y, false));
 }
コード例 #15
0
 protected virtual void OnDragCompleted()
 {
     _isDragging = false;
     DragCompleted?.Invoke(this, EventArgs.Empty);
 }