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
parent
commit
5b015d54dc
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/Avalonia.Controls/ComboBox.cs
  2. 4
      src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs

4
src/Avalonia.Controls/ComboBox.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.

4
src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs

@ -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.

Loading…
Cancel
Save