When I use the following xaml in Silverlight 4, the ScrollViewer will not recognize the mouse wheel unless I click once on the scroll bar thumb, and keep the mouse over the scroll bar, while turning the mouse wheel.
<Grid x:Name="LayoutRoot" Background="White">
<ScrollViewer>
<StackPanel Name="stackPanel1">
<Button Content="Button 1" Width="150" />
<Button Content="Button 2" Width="150" Margin="0,20,0,0" />
<Button Content="Button 3" Width="150" Margin="0,20,0,0" />
<Button Content="Button 4" Width="150" Margin="0,20,0,0" />
<Button Content="Button 5" Width="150" Margin="0,20,0,0" />
<Button Content="Button 6" Width="150" Margin="0,20,0,0" />
<Button Content="Button 7" Width="150" Margin="0,20,0,0" />
</StackPanel>
</ScrollViewer>
</Grid>
Has anyone else experience this, and is there any work around?
The resolution here seems to be set a background brush on the ScrollViewer. In my case I chose to use the Transparent brush. It seems to be related to hit testing whereby a control without a brush will never receive any mouse events.
<ScrollViewer Background="Transparent">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With