I have a ListBox which holds three different sized types of items. The items’ heights are the following:
I want the layout of the items with no padding or margin between them.
But I’m getting this result:
There is a margin between items with different height/width.
What I want to do is to remove this margin between these items and have them right next to each other, but I do not know what panel to use, or what to style.
Here is the XAML for the ListBox. The items are part of a viewmodel with an enum representing the aspect ratio (16:9, 1:1, 9:16)
You need to remove the border on the ListViewItems.
- Create a ListViewItemStyle resource ( you can right click on the Listbox/Edit Additional templates/Edit Copy)
- The created XAML follows with hand modification of the BorderThickness :
EDIT : ** ** Sorry the XAML solution not visible !
And the style is assigned to the ListBox :