|
|
@ -85,7 +85,8 @@ namespace Avalonia.Controls |
|
|
/// Defines the <see cref="Text"/> property
|
|
|
/// Defines the <see cref="Text"/> property
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public static readonly StyledProperty<string?> TextProperty = |
|
|
public static readonly StyledProperty<string?> TextProperty = |
|
|
TextBlock.TextProperty.AddOwner<ComboBox>(new(string.Empty, BindingMode.TwoWay)); |
|
|
TextBlock.TextProperty.AddOwner<ComboBox>(new(string.Empty, BindingMode.TwoWay, |
|
|
|
|
|
enableDataValidation: true)); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Defines the <see cref="SelectionBoxItemTemplate"/> property.
|
|
|
/// Defines the <see cref="SelectionBoxItemTemplate"/> property.
|
|
|
@ -236,6 +237,14 @@ namespace Avalonia.Controls |
|
|
UpdateFlowDirection(); |
|
|
UpdateFlowDirection(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected override void UpdateDataValidation(AvaloniaProperty property, BindingValueType state, Exception? error) |
|
|
|
|
|
{ |
|
|
|
|
|
base.UpdateDataValidation(property, state, error); |
|
|
|
|
|
|
|
|
|
|
|
if (property == TextProperty) |
|
|
|
|
|
DataValidationErrors.SetError(this, error); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected internal override Control CreateContainerForItemOverride(object? item, int index, object? recycleKey) |
|
|
protected internal override Control CreateContainerForItemOverride(object? item, int index, object? recycleKey) |
|
|
{ |
|
|
{ |
|
|
return new ComboBoxItem(); |
|
|
return new ComboBoxItem(); |
|
|
|