|
|
@ -468,10 +468,11 @@ namespace Avalonia.Controls |
|
|
/// <see cref="P:Avalonia.Controls.AutoCompleteBox.Text" />
|
|
|
/// <see cref="P:Avalonia.Controls.AutoCompleteBox.Text" />
|
|
|
/// dependency property.</value>
|
|
|
/// dependency property.</value>
|
|
|
public static readonly DirectProperty<AutoCompleteBox, string> TextProperty = |
|
|
public static readonly DirectProperty<AutoCompleteBox, string> TextProperty = |
|
|
AvaloniaProperty.RegisterDirect<AutoCompleteBox, string>( |
|
|
TextBlock.TextProperty.AddOwnerWithDataValidation<AutoCompleteBox>( |
|
|
nameof(Text), |
|
|
|
|
|
o => o.Text, |
|
|
o => o.Text, |
|
|
(o, v) => o.Text = v); |
|
|
(o, v) => o.Text = v, |
|
|
|
|
|
defaultBindingMode: BindingMode.TwoWay, |
|
|
|
|
|
enableDataValidation: true); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Identifies the
|
|
|
/// Identifies the
|
|
|
@ -1244,6 +1245,20 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
|
base.OnApplyTemplate(e); |
|
|
base.OnApplyTemplate(e); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Called to update the validation state for properties for which data validation is
|
|
|
|
|
|
/// enabled.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="property">The property.</param>
|
|
|
|
|
|
/// <param name="value">The new binding value for the property.</param>
|
|
|
|
|
|
protected override void UpdateDataValidation<T>(AvaloniaProperty<T> property, BindingValue<T> value) |
|
|
|
|
|
{ |
|
|
|
|
|
if (property == TextProperty) |
|
|
|
|
|
{ |
|
|
|
|
|
DataValidationErrors.SetError(this, value.Error); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Provides handling for the
|
|
|
/// Provides handling for the
|
|
|
|