1.引用基础类型填充下拉列表
- 引用命名空间:xmlns:sys="clr-namespace:System;assembly=mscorlib"
<ComboBox x:Name="ComboState" SelectedIndex="0" Height="28" SelectedValue="{Binding SelectedTarget,Mode=TwoWay}" >
<ComboBox.Items>
<sys:String>expand</sys:String>
<sys:String>iframe</sys:String>
<sys:String>open</sys:String>
<sys:String>href</sys:String>
<sys:String>blank</sys:String>
</ComboBox.Items>
</ComboBox>
2. 后台集合方式绑定下拉列表
<ComboBox x:Name="ComboState" ItemsSource="{Binding Targets}" DisplayMemberPath="Name" SelectedValuePath="Value"
SelectedIndex="0" Height="28" SelectedValue="{Binding SelectedTarget,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
</ComboBox>