ComboBox 下拉菜单
当选项过多时,使用下拉菜单展示并选择内容。
依次为普通ComboBox 、带清除的ComboBox、可编辑的ComboBox、带清除的可编辑ComboBox
使用方式
<Page.Resources>
<sysCollection:ArrayList x:Key="ComboBoxSource">
<sys:String>黄金糕</sys:String>
<sys:String>双皮奶</sys:String>
<sys:String>蚵仔煎</sys:String>
<sys:String>龙须面</sys:String>
<sys:String>北京烤鸭</sys:String>
</sysCollection:ArrayList>
</Page.Resources>
<WrapPanel Margin="20" x:Name="panel">
<ComboBox ItemsSource="{Binding Source={StaticResource ComboBoxSource}}"></ComboBox>
<ComboBox lib:Assists.Clearable="True" ItemsSource="{Binding Source={StaticResource ComboBoxSource}}"></ComboBox>
<Separator Width="{Binding ElementName=panel,Path=ActualWidth}" Margin="0 20"></Separator>
<ComboBox IsEditable="True" ItemsSource="{Binding Source={StaticResource ComboBoxSource}}"></ComboBox>
<ComboBox IsEditable="True" lib:Assists.Clearable="True" ItemsSource="{Binding Source={StaticResource ComboBoxSource}}"></ComboBox>
</WrapPanel>
源码地址:https://github.com/Super0Lan/ControlDesign
涉及到文件:ComboBoxAssit.cs;Themes/ComboBox.xaml;Assists.cs