fix: fix NumericUpDownBase validation propagation.
This commit is contained in:
@@ -380,7 +380,7 @@ public abstract class NumericUpDownBase<T> : NumericUpDown where T : struct, ICo
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<T?> ValueProperty = AvaloniaProperty.Register<NumericUpDownBase<T>, T?>(
|
||||
nameof(Value), defaultBindingMode: BindingMode.TwoWay);
|
||||
nameof(Value), defaultBindingMode: BindingMode.TwoWay, enableDataValidation: true);
|
||||
|
||||
public T? Value
|
||||
{
|
||||
@@ -485,6 +485,15 @@ public abstract class NumericUpDownBase<T> : NumericUpDown where T : struct, ICo
|
||||
set => this.SetValue(CommandParameterProperty, value);
|
||||
}
|
||||
|
||||
protected override void UpdateDataValidation(AvaloniaProperty property, BindingValueType state, Exception? error)
|
||||
{
|
||||
if (property == ValueProperty)
|
||||
{
|
||||
DataValidationErrors.SetError(this, error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void InvokeCommand(object? cp)
|
||||
{
|
||||
if (this.Command != null && this.Command.CanExecute(cp))
|
||||
|
||||
Reference in New Issue
Block a user