DataTrigger を使用して、バインドされている SelectedItem が null の場合、ComboBox の SelectedIndex を 0 に設定したいと考えています。しかし、それは機能していません。どこが間違っていますか?
xaml は次のとおりです。
<ComboBox SelectedItem="{Binding MyObject.color_master, Mode=TwoWay}"
ItemsSource="{Binding MyEntities.color_master}"
DislayMemberPath="COLOR_DESCRIPTION" >
<ComboBox.Style>
<Style TargetType="ComboBox">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=MyObject.color_master}" Value="{x:Null}">
<Setter Property="SelectedIndex" Value="0" />
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
</ComboBox>
ここでMyObject.color_masterはnullですが、それでも DataTrigger は機能していません!
私の要件は非常に単純です。コンボボックスで何も選択されていない場合、最初の項目を選択したいです。