私は次のリストボックスを持っています:
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,10,0,10">
<TextBlock
Foreground="Black"
Text="{Binding name}"/>
<TextBlock
Foreground="Black"
Text=": "
Visibility="{Binding
Path=name,
Converter={StaticResource ServiceOtherConverter}}"/>
<TextBlock
Foreground="Black"
Text="{Binding amount}"
Visibility="{Binding
Path=name,
Converter={StaticResource ServiceOtherConverter}}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
また、私のアプリの背景は白なので、リストアイテムの前景を黒に設定したいと思います。しかし、アイテムを選択しても、デフォルトの前景と同じように、その前景は変更されません。
リストアイテムの前景を黒に変更しても、選択した前景を変更するにはどうすればよいですか?