It seems to me that the 'Rectangle' that you're talking about is just the ListBoxItem.Background
. It also looks like the default selection Color
used in the ListBox
control. If that's what it is, you can easily hide this by setting some property values in a local Resources
section. Try adding these to your ListBox.Resources
section:
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Black" />
</Style.Resources>