查看以下示例中的“THIS LINE ####”行。
<ListBox Grid.Row="0" x:Name="listBoxServers">
<ListBoxItem HorizontalContentAlignment="Stretch">
<StackPanel>
<TextBlock><Run Text="My computer"/></TextBlock>
<TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
<TextBlock.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" Value="True">
<Setter Property="TextBlock.Foreground" Value="White" /> <!-- THIS LINE #### How can I get this work? -->
<Setter Property="TextBlock.Background" Value="Blue" /> <!-- This line here for debugging purposes (to show that these really are called) -->
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
<Run Text="localhost"/>
</TextBlock>
</StackPanel>
</ListBoxItem>
</ListBox>
如何获得以下触发器来覆盖该值?
(顺便说一句,上面的例子只是压缩的。(在实际应用中,样式在它自己的资源中。))