I have following ListView:
<ListView ItemsSource="{Binding ArtistList}">
<ListView.ItemTemplate>
<DataTemplate>
<Border BorderThickness="0,0,0,0.5" BorderBrush="#22ffffff" Tapped="ArtistTapped">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Ellipse Grid.Column="0" Canvas.ZIndex="0" Fill="#22ffffff" Width="50" Height="50" Margin="0,10"/>
<Ellipse Grid.Column="0" Canvas.ZIndex="1" Stretch="UniformToFill" Width="50" Height="50" Margin="0,10">
<Ellipse.Fill>
<ImageBrush ImageSource="{Binding firstAlbumArt}"/>
</Ellipse.Fill>
</Ellipse>
<StackPanel Grid.Column="1" Margin="20,10,0,10">
<TextBlock Text="{Binding name}" Foreground="#ffffffff" FontFamily="Segoe WP" FontSize="18"/>
<TextBlock Foreground="#aaffffff" FontFamily="Segoe WP" FontWeight="Light" FontSize="14">
<Run Text="{Binding amountofalbums}"/>
<Run Text="album(s)"/>
</TextBlock>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
When I scroll up and down, the ListView moves slightly right and left, which is very irritating. There are two ways to fix this:
Removing the ItemContainerStyle => items aren't stretched anymore which is necessary
Adding HorizontalAlignment = left to the ListView => again, items aren't stretched anymore...
Is there a way to keep the ListView from jumping left and right while maintaining stretched ListViewItems?