fix: fix readonly, remove AllowWheel.

This commit is contained in:
rabbitism
2024-01-16 13:55:17 +08:00
parent d3c54f3088
commit 697b03aed7

View File

@@ -108,15 +108,6 @@ public abstract class NumericUpDown : TemplatedControl
set => SetValue(AllowSpinProperty, value); set => SetValue(AllowSpinProperty, value);
} }
public static readonly StyledProperty<bool> AllowMouseWheelProperty = AvaloniaProperty.Register<NumericUpDown, bool>(
nameof(AllowMouseWheel));
public bool AllowMouseWheel
{
get => GetValue(AllowMouseWheelProperty);
set => SetValue(AllowMouseWheelProperty, value);
}
public event EventHandler<SpinEventArgs>? Spinned; public event EventHandler<SpinEventArgs>? Spinned;
static NumericUpDown() static NumericUpDown()
@@ -223,7 +214,7 @@ public abstract class NumericUpDown : TemplatedControl
private void OnDragPanelPointerMoved(object sender, PointerEventArgs e) private void OnDragPanelPointerMoved(object sender, PointerEventArgs e)
{ {
if (!AllowDrag) return; if (!AllowDrag || IsReadOnly) return;
if(!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return; if(!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
var point = e.GetPosition(this); var point = e.GetPosition(this);
var delta = point - _point; var delta = point - _point;