I have a problem with the scrollviewer.
First of all here's my code:
<GroupBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Header="Pictures"
Margin="5,2,2,2">
<ScrollViewer Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" Margin="2">
<ListView ItemsSource="{Binding ImageBoxes, UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" ScrollViewer.CanContentScroll="True"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Red"/>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/>
</Style.Resources>
<Setter Property="BorderBrush" Value="Orange"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="2"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
</ListView>
</ScrollViewer>
</GroupBox>
The ItemsSouce of the ListView is bound to an ObservableCollection in the model. All items are displayed correctly. I only want to scroll up and down, and this works fine.
My Problem is, that I only can scroll by moving the scrollbar up or down with the cursor. the mouse-wheel doesn't work. I need this to work.
What is the problem here?