feat: Add Clear.

This commit is contained in:
rabbitism
2024-01-15 00:07:09 +08:00
parent 296777febb
commit 8230c8ec24
3 changed files with 46 additions and 1 deletions

View File

@@ -290,6 +290,8 @@ public abstract class NumericUpDown : TemplatedControl
protected abstract bool SyncTextAndValue(bool fromTextToValue = false, string? text = null,
bool forceTextUpdate = false);
public abstract void Clear();
}
public abstract class NumericUpDownBase<T>: NumericUpDown where T: struct, IComparable<T>
@@ -613,4 +615,9 @@ public abstract class NumericUpDownBase<T>: NumericUpDown where T: struct, IComp
protected abstract T? Add(T? a, T? b);
protected abstract T? Minus(T? a, T? b);
public override void Clear()
{
SetCurrentValue(ValueProperty, EmptyInputValue);
SyncTextAndValue(false, forceTextUpdate: true);
}
}