|
|
@ -610,6 +610,13 @@ namespace Avalonia.Controls |
|
|
o => o.AsyncPopulator, |
|
|
o => o.AsyncPopulator, |
|
|
(o, v) => o.AsyncPopulator = v); |
|
|
(o, v) => o.AsyncPopulator = v); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the <see cref="TextChanged"/> event.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static readonly RoutedEvent<TextChangedEventArgs> TextChangedEvent = |
|
|
|
|
|
RoutedEvent.Register<AutoCompleteBox, TextChangedEventArgs>( |
|
|
|
|
|
nameof(TextChanged), RoutingStrategies.Bubble); |
|
|
|
|
|
|
|
|
private static bool IsValidMinimumPrefixLength(int value) => value >= -1; |
|
|
private static bool IsValidMinimumPrefixLength(int value) => value >= -1; |
|
|
|
|
|
|
|
|
private static bool IsValidMinimumPopulateDelay(TimeSpan value) => value.TotalMilliseconds >= 0.0; |
|
|
private static bool IsValidMinimumPopulateDelay(TimeSpan value) => value.TotalMilliseconds >= 0.0; |
|
|
@ -1529,10 +1536,14 @@ namespace Avalonia.Controls |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Occurs when the text in the text box portion of the
|
|
|
/// Occurs asynchronously when the text in the <see cref="TextBox"/> portion of the
|
|
|
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" /> changes.
|
|
|
/// <see cref="AutoCompleteBox" /> changes.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public event EventHandler? TextChanged; |
|
|
public event EventHandler<TextChangedEventArgs>? TextChanged |
|
|
|
|
|
{ |
|
|
|
|
|
add => AddHandler(TextChangedEvent, value); |
|
|
|
|
|
remove => RemoveHandler(TextChangedEvent, value); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Occurs when the
|
|
|
/// Occurs when the
|
|
|
@ -1690,15 +1701,12 @@ namespace Avalonia.Controls |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Raises the
|
|
|
/// Raises the <see cref="TextChanged" /> event.
|
|
|
/// <see cref="E:Avalonia.Controls.AutoCompleteBox.TextChanged" />
|
|
|
|
|
|
/// event.
|
|
|
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="e">A <see cref="T:Avalonia.RoutedEventArgs" />
|
|
|
/// <param name="e">A <see cref="TextChangedEventArgs" /> that contains the event data.</param>
|
|
|
/// that contains the event data.</param>
|
|
|
protected virtual void OnTextChanged(TextChangedEventArgs e) |
|
|
protected virtual void OnTextChanged(RoutedEventArgs e) |
|
|
|
|
|
{ |
|
|
{ |
|
|
TextChanged?.Invoke(this, e); |
|
|
RaiseEvent(e); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -1985,7 +1993,7 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
|
if (callTextChanged) |
|
|
if (callTextChanged) |
|
|
{ |
|
|
{ |
|
|
OnTextChanged(new RoutedEventArgs()); |
|
|
OnTextChanged(new TextChangedEventArgs(TextChangedEvent)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|