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>