public static void OnPointerPressed(RadialSlider slider, PointerRoutedEventArgs e) { slider.CapturePointer(e.Pointer); _lastPoint = e.GetCurrentPoint(slider); _isDragActive = true; e.Handled = true; }
public static void OnPointerReleased(RadialSlider slider, PointerRoutedEventArgs e) { slider.ReleasePointerCapture(e.Pointer); _isDragActive = false; if (_lastPoint.Position.X < 0 || _lastPoint.Position.Y < 0 || _lastPoint.Position.X > slider.ActualWidth || _lastPoint.Position.Y > slider.ActualHeight) slider.RaiseOnPointerExited(e); e.Handled = true; }
public static void OnPointerMoved(RadialSlider slider, PointerRoutedEventArgs e) { if (_isDragActive) { PointerPoint currentPoint = e.GetCurrentPoint(slider); double delta = _lastPoint.Position.Y - currentPoint.Position.Y; if (e.KeyModifiers != slider.SlowerKey || slider.SlowerKey == null) slider.Value = slider.Normalize(slider.Value + delta / 10 * slider.LargeChange); else slider.Value = slider.Normalize(slider.Value + delta / 10 * slider.SmallChange); _lastPoint = currentPoint; e.Handled = true; } }