From 4105a38a38d90d17ad9a6c53c3fab8d3b5330573 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:23:51 +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 673dc3d..d54b4b2 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml @@ -11,42 +11,46 @@ - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - - - - - - - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/ComboBox.axaml b/src/Semi.Avalonia/Controls/ComboBox.axaml index 25553e2..ef01901 100644 --- a/src/Semi.Avalonia/Controls/ComboBox.axaml +++ b/src/Semi.Avalonia/Controls/ComboBox.axaml @@ -67,8 +67,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}}" /> + +