feat: ComboBox respects SelectionBoxItemTemplate

This commit is contained in:
Ge 2024-12-07 00:49:29 +08:00 committed by Gehongyan
parent 9cabf55ebd
commit f3c4714372
2 changed files with 10 additions and 1 deletions

View File

@ -27,6 +27,15 @@
<ComboBox Classes="Small" />
<ComboBox Classes="Bordered" />
<ComboBox Classes="Bordered" IsEnabled="False" />
<ComboBox>
<ComboBox.SelectionBoxItemTemplate>
<DataTemplate DataType="x:String">
<ContentControl BorderThickness="1"
BorderBrush="Gold"
Content="{Binding}" />
</DataTemplate>
</ComboBox.SelectionBoxItemTemplate>
</ComboBox>
<StackPanel Orientation="Horizontal">
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" />

View File

@ -76,7 +76,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding ItemTemplate}" />
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" />
<Button
Name="ClearButton"
Grid.Column="1"