From be2b25a94b7615c658436923571c4a4a538fdc89 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Sat, 4 Oct 2025 11:11:07 +0800 Subject: [PATCH] feat: implement IsEditable for ComboBox. --- .../Pages/ComboBoxDemo.axaml | 74 ++++++++++--------- src/Semi.Avalonia/Controls/ComboBox.axaml | 30 +++++++- src/Semi.Avalonia/Controls/TextBox.axaml | 1 + 3 files changed, 67 insertions(+), 38 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml index 6153782..750e0bd 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml @@ -12,42 +12,46 @@ - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - - - - - - - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/ComboBox.axaml b/src/Semi.Avalonia/Controls/ComboBox.axaml index 73958ca..fe2d055 100644 --- a/src/Semi.Avalonia/Controls/ComboBox.axaml +++ b/src/Semi.Avalonia/Controls/ComboBox.axaml @@ -66,8 +66,14 @@ VerticalAlignment="{TemplateBinding VerticalContentAlignment}" TextTrimming="CharacterEllipsis" Foreground="{TemplateBinding PlaceholderForeground}" - IsVisible="{TemplateBinding SelectionBoxItem,Converter={x:Static ObjectConverters.IsNull}}" - Text="{TemplateBinding PlaceholderText}" /> + Text="{TemplateBinding PlaceholderText}"> + + + + + + + + ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" + IsVisible="{TemplateBinding IsEditable, Converter={x:Static BoolConverters.Not}}" /> + +