feat: improve demo. make textbox interactive.

This commit is contained in:
rabbitism
2025-09-14 10:39:05 +08:00
parent 9f71b5f382
commit 8ec815c885
5 changed files with 106 additions and 6 deletions

View File

@@ -3,6 +3,8 @@
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:MultiAutoCompleteBox}" TargetType="u:MultiAutoCompleteBox">
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:MultiAutoCompleteBox">
<Panel>

View File

@@ -32,7 +32,7 @@ public partial class MultiAutoCompleteBox
/// <value>The identifier for the <see cref="MinimumPrefixLength" /> property.</value>
public static readonly StyledProperty<int> MinimumPrefixLengthProperty =
AvaloniaProperty.Register<MultiAutoCompleteBox, int>(
nameof(MinimumPrefixLength), 1,
nameof(MinimumPrefixLength), 0,
validate: IsValidMinimumPrefixLength);
/// <summary>

View File

@@ -585,7 +585,7 @@ public partial class MultiAutoCompleteBox : TemplatedControl, IInnerContentContr
protected override void OnLoaded(RoutedEventArgs e)
{
base.OnLoaded(e);
var textbox = (_selectedItemsControl?.ItemsPanelRoot as WrapPanelWithTrailingItem)?.TrailingItem as TextBox;
TextBox = (_selectedItemsControl?.ItemsPanelRoot as WrapPanelWithTrailingItem)?.TrailingItem as TextBox;
}
/// <summary>