I am trying to allow the ScrollViewer to take stretch and fit size of the screen but I’m not managing as it is still keeping the size of the listview.
Is there any way that this can be done?
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
<ListView ScrollViewer.VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden">
<ListView.View>
<GridView>
<!-- code -->
</GridView>
</ListView.View>
</ListView>
</ScrollViewer>
</Grid>
The problem was I had a StackPanel in the parent window as the above was in a UserControl. Changed the StackPanel to a DockPanel and worked.