I still do not understand. Could you show me how to override the default behavior in a ListBox. Each time a ListBoxItem is selected, the background of the border must be changed. Not the background of the entire line, but only the background of the border that is indicated.
<ListBox ItemsSource="{Binding Source={StaticResource AssetsViewSource}}">
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderThickness="2" BorderBrush="Black">
<StackPanel>
<TextBlock Text="Name: " />
<TextBlock Text="{Binding Name}" />
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
source
share