I want to grey out some text when some piece of data is "Ignored", but I don't want the grey out to happen when the item is selected. (Specifically, in high contrast mode, setting the color to the grey value causes the text to be unreadable)
This was my first attempt to do that.
<Style> <!-- .... --> <Setter Property="Control.Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextColor}}" /> <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> <!-- Set gray text when not selected, and ignored. --> <Condition Property="ListBoxItem.IsSelected" Value="false" /> <Condition Binding="{Binding Ignored}" Value="true" /> </MultiDataTrigger.Conditions> <Setter Property="Control.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextColor}}" /> </MultiDataTrigger> </Style.Triggers> </Style> This fails at runtime because MultiDataTrigger needs Binding to be set on its conditions. (At least, I think that's why it is failing.)
How can I work around this problem?