protected override void StartTouch(PTouch args) { if (Contains(args)) { SliderValueChanged?.Invoke(ValueFromPoint(args.Position)); } }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (!isTouched) { return; } if (e.LeftButton == MouseButtonState.Released) { isTouched = false; return; } Point pt = e.GetPosition(this); int num = (int)((pt.X - Mar) / marAndWidth); if (num < 0) { num = 0; } else if (num >= MaxLedNum) { num = MaxLedNum; } SliderValueChanged?.Invoke(this, num); }
private void Slide_ValueChanged(object sender, EventArgs e) { if (Update) { SliderValueChangedHandler?.Invoke(sender, e); } }
protected override void OnMouseWheel(MouseWheelEventArgs e) { base.OnMouseWheel(e); if (!this.IsFocused) { return; } int num = LedNum + e.Delta / 120; if (num < 0) { num = 0; } else if (num >= MaxLedNum) { num = MaxLedNum; } SliderValueChanged?.Invoke(this, num); }
protected override void OnMouseDown(MouseButtonEventArgs e) { this.Focus(); this.CaptureMouse(); Point pt = e.GetPosition(this); int num = (int)((pt.X - Mar) / marAndWidth); if (pt.X >= (num * marAndWidth /*+ Mar*/) && pt.X < this.ActualWidth - Mar /*((num + 1) * marAndWidth)*/) { if (num < 0) { num = 0; } else if (num >= MaxLedNum) { num = MaxLedNum; } isTouched = true; SliderValueChanged?.Invoke(this, num); } }
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { SliderValueChanged?.Invoke(sender, e); }
private void slider_ValueChanged(object sender, EventArgs e) { this.SliderValue = this.slider.Value; SliderValueChanged?.Invoke(sender, e); }
private void OnSliderValueChange(EventArgs e) { SliderValueChanged?.Invoke(this, e); }
void Handle_ValueChanged(object sender, Xamarin.Forms.ValueChangedEventArgs e) { SliderValueChanged?.Invoke(this, e.NewValue); }