Merge pull request #366 from irihitech/issue/363

NumericUpDown family updates
This commit is contained in:
Dong Bin
2024-08-27 18:36:03 +08:00
committed by GitHub
5 changed files with 48 additions and 26 deletions

View File

@@ -17,7 +17,7 @@ namespace Ursa.Controls;
[TemplatePart(PART_Spinner, typeof(ButtonSpinner))]
[TemplatePart(PART_TextBox, typeof(TextBox))]
[TemplatePart(PART_DragPanel, typeof(Panel))]
public abstract class NumericUpDown : TemplatedControl, IClearControl
public abstract class NumericUpDown : TemplatedControl, IClearControl, IInnerContentControl
{
public const string PART_Spinner = "PART_Spinner";
public const string PART_TextBox = "PART_TextBox";
@@ -62,8 +62,9 @@ public abstract class NumericUpDown : TemplatedControl, IClearControl
set => SetValue(HorizontalContentAlignmentProperty, value);
}
public static readonly StyledProperty<object?> InnerLeftContentProperty = AvaloniaProperty.Register<NumericUpDown, object?>(
nameof(InnerLeftContent));
public static readonly StyledProperty<object?> InnerLeftContentProperty =
AvaloniaProperty.Register<NumericUpDown, object?>(
nameof(InnerLeftContent));
public object? InnerLeftContent
{
@@ -71,6 +72,16 @@ public abstract class NumericUpDown : TemplatedControl, IClearControl
set => SetValue(InnerLeftContentProperty, value);
}
public static readonly StyledProperty<object?> InnerRightContentProperty =
AvaloniaProperty.Register<NumericUpDown, object?>(
nameof(InnerRightContent));
public object? InnerRightContent
{
get => GetValue(InnerRightContentProperty);
set => SetValue(InnerRightContentProperty, value);
}
public static readonly StyledProperty<string?> WatermarkProperty = AvaloniaProperty.Register<NumericUpDown, string?>(
nameof(Watermark));