2
我有一个wpf组合框绑定到我的viewmodel中的IEnumberable集合。当组合框第一次绑定时,选择一个空值。在组合框中选择任何其他值时,空值将消失。有没有办法让空值保留而不改变集合?WPF comobox绑定空值
<ComboBox ItemsSource="{Binding CarCollection}" SelectedItem="{Binding SelectedCar}"
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding CarName}" VerticalAlignment="Center"
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>