This is part of my window: MyListBox. I would like the space between the items to be green as well (if the upper and lower item is green) but I don't know how to change it.
This is my XAML code (tried to put the background colour in the StackPanel but nothing changed):
<ListBox Background="LightCyan" Name="MondayListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Background="{Binding backgroundColor}">
<TextBlock Text="{Binding Time, StringFormat={}{0:hh}:{0:mm}}" Background="{Binding BackgroundColor}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Any suggestion would be very appreciated.
EDIT:
I setted the backgorundColor
to be a Brush
and initialized it with Brushes.LightCyan
but I still have the white spaces between the items.