Browse Source
Update Placeholder properties to use TextBox as owner in NumericUpDown & ComboBox (#20929)
* feat: update PlaceholderText and PlaceholderForeground properties to use TextBox as owner in NumericUpDown and ComboBox.
* chore: disable warning.
pull/20850/merge
Zhang Dian
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
5 additions and
3 deletions
-
src/Avalonia.Controls/ComboBox.cs
-
src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs
|
|
|
@ -62,13 +62,13 @@ namespace Avalonia.Controls |
|
|
|
/// Defines the <see cref="PlaceholderText"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly StyledProperty<string?> PlaceholderTextProperty = |
|
|
|
AvaloniaProperty.Register<ComboBox, string?>(nameof(PlaceholderText)); |
|
|
|
TextBox.PlaceholderTextProperty.AddOwner<ComboBox>(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="PlaceholderForeground"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly StyledProperty<IBrush?> PlaceholderForegroundProperty = |
|
|
|
AvaloniaProperty.Register<ComboBox, IBrush?>(nameof(PlaceholderForeground)); |
|
|
|
TextBox.PlaceholderForegroundProperty.AddOwner<ComboBox>(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="HorizontalContentAlignment"/> property.
|
|
|
|
|
|
|
|
@ -112,7 +112,9 @@ namespace Avalonia.Controls |
|
|
|
/// Defines the <see cref="PlaceholderText"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly StyledProperty<string?> PlaceholderTextProperty = |
|
|
|
AvaloniaProperty.Register<NumericUpDown, string?>(nameof(PlaceholderText)); |
|
|
|
#pragma warning disable AVP1013
|
|
|
|
TextBox.PlaceholderTextProperty.AddOwner<NumericUpDown>(); |
|
|
|
#pragma warning restore AVP1013
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="Watermark"/> property.
|
|
|
|
|