Reputation: 4341
I have next XAML for main grid:
<ListView Grid.Row="1" x:Name="NewsListBox">
<ListView.Background>
<SolidColorBrush Color="#FF006C67" Opacity="0.5"/>
</ListView.Background>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
And it looks nice, how it is needed:
But it doesn't scroll the content!
Ok, i add ScrollViewer:
<ScrollViewer Grid.Row="1" VerticalScrollMode="Disabled" ZoomMode="Disabled">
<ListView Grid.Row="1" x:Name="NewsListBox">
<ListView.Background>
<SolidColorBrush Color="#FF006C67" Opacity="0.5"/>
</ListView.Background>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</ScrollViewer>
And it stacks everything vertically:
What am i doing wrong?
Upvotes: 4
Views: 2551
Reputation: 21
You can try this
<ListView
ScrollViewer.HorizontalScrollMode="Enabled"
ScrollViewer.VerticalScrollMode="Disabled"
>
Upvotes: 1
Reputation: 4341
Found a solution. No ScrollViewer is needed.
Just had to replace ListView with GridView because ListView isn't designed for horizontal scrolling.
Upvotes: 5