私のコンボボックスは状態のリストにバインドされています。状態には列があり、trueの場合、コンボアイテムの前景色は赤になります。これは正常に機能します。しかし、前景色が赤のコンボボックスアイテムを選択すると、その前景色が失われ、黒に設定されます。誰かが私が間違っていることを指摘するのを手伝ってもらえますか?
<ComboBox Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type ComboBoxItem}},Path=Foreground}"
DisplayMemberPath="StateName"
ItemsSource="{Binding States}"
SelectedValue="{Binding Model.StateID}" SelectedValuePath="StateID" >
<ComboBox.ItemContainerStyle>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="Foreground" Value="{Binding DoesNotParticipate, Converter={StaticResource NonParticipatingConverter}}"/>
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>