I have a ListView that goes something like this:
<ListView
x:Name="SeriesListView"
SnapsToDevicePixels="True"
ItemsSource="{Binding Items}"
BorderBrush="Transparent" BorderThickness="0"
Padding="0" Margin="0"
VerticalContentAlignment="Top"
Background="Purple"
LostFocus="ListView_LostFocus"
>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<local:LDSeriesPanel
SnapsToDevicePixels="True"
MaxWidth="{Binding ElementName=itControl,Path=ActualWidth}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
MinHeight="{x:Static local:LDSeriesPanel.MIN_HEIGHT}"
MinWidth="{x:Static local:LDSeriesPanel.MIN_WIDTH}"
Margin="0"
Background="Aquamarine"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
When it's empty, the Width and Height of the custom panel I've defined is 15 x 15. I can confirm these are the actual dimensions at runtime. However, the ListView itself has dimensions of 17 x 17 (that is, a one pixel border between the panel and the ListView).
Starting from the custom panel and walking up the tree, I get the following ancestors:
- ItemsPresenter: 15x15
- ScrollViewer: 15x15
- Grid: 15x15
- ScrollViewer: 15x15
- Border: 17x17
- ListView: 17x17
If I change the Padding on the ListView to -1, it removes the border but causes several other issues.
I'm hoping to avoid retemplating the entire ListView. Everything else is working fine. Is there some way I can Remove this one pixel border, perhaps through a style?