Code: Select all
<ListBox
SelectedItemBackground="Blue">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock
Text="{Binding .}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
ListBox.SelectedItemBackground not working:
Code: Select all
<ListBox
SelectedItemBackground="Blue">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock
Text="{Binding .}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>