Browse Source
Merge pull request #12368 from workgroupengineering/features/Controls/NumericUpDown/TextAlignment
feat(NumericUpDown): TextAlignment
pull/12347/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
17 additions and
0 deletions
-
src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs
-
src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml
-
src/Avalonia.Themes.Simple/Controls/NumericUpDown.xaml
|
|
|
@ -126,6 +126,12 @@ namespace Avalonia.Controls |
|
|
|
public static readonly StyledProperty<VerticalAlignment> VerticalContentAlignmentProperty = |
|
|
|
ContentControl.VerticalContentAlignmentProperty.AddOwner<NumericUpDown>(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="TextAlignment"/> property
|
|
|
|
/// </summary>
|
|
|
|
public static readonly StyledProperty<Media.TextAlignment> TextAlignmentProperty = |
|
|
|
TextBox.TextAlignmentProperty.AddOwner<NumericUpDown>(); |
|
|
|
|
|
|
|
private IDisposable? _textBoxTextChangedSubscription; |
|
|
|
|
|
|
|
private bool _internalValueSet; |
|
|
|
@ -299,6 +305,15 @@ namespace Avalonia.Controls |
|
|
|
set => SetValue(VerticalContentAlignmentProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the <see cref="Media.TextAlignment"/> of the <see cref="NumericUpDown"/>
|
|
|
|
/// </summary>
|
|
|
|
public Media.TextAlignment TextAlignment |
|
|
|
{ |
|
|
|
get => GetValue(TextAlignmentProperty); |
|
|
|
set => SetValue(TextAlignmentProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes new instance of <see cref="NumericUpDown"/> class.
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
@ -57,6 +57,7 @@ |
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
Text="{TemplateBinding Text}" |
|
|
|
TextAlignment="{TemplateBinding TextAlignment}" |
|
|
|
AcceptsReturn="False" |
|
|
|
TextWrapping="NoWrap" /> |
|
|
|
</ButtonSpinner> |
|
|
|
|
|
|
|
@ -31,6 +31,7 @@ |
|
|
|
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" |
|
|
|
IsReadOnly="{TemplateBinding IsReadOnly}" |
|
|
|
Text="{TemplateBinding Text}" |
|
|
|
TextAlignment="{TemplateBinding TextAlignment}" |
|
|
|
TextWrapping="NoWrap" |
|
|
|
Watermark="{TemplateBinding Watermark}" /> |
|
|
|
</ButtonSpinner> |
|
|
|
|