I have an UserControl containing a ScrollViewer with "sychronized" ScrollBar associated with it binding both the ViewportSize and Maximum ScrollBar's properties, simplified code:
//xaml
<ScrollViewer x:Name="scViewer" <!--and its content-->/>
<ScrollBar ViewportSize="{Binding ViewportWidth, ElementName=scViewer}"
Maximum="{Binding ScrollableWidth, ElementName=scViewer}" x:Name="scHBar"
Orientation="Horizontal" Scroll="HScrollBar_Scroll"/>
//code behind
private void HScrollBar_Scroll(object sender, ScrollEventArgs e)
{
scViewer.ScrollToHorizontalOffset(e.NewValue);//and the other way around
}
It works as expected, except when user clicks up/down arrows on ScrollBar the speed is very slow, 0.1px for each click to be precise, which requires user to click 10 times(!) to scroll a pixel. Strangely enough, the mouse wheel scrolling speed is fine just as dragging the bar speed is.
The only solution which comes to my mind is multiplying the e.NewValue delta, however I dont know whether the source was one of the arrow buttons(not mouse wheel or bar drag) so it would break every other type of interaction.
There are quite a lot questions about scrolling speed of mouse wheel, however I was unable to find a single one mentioning the speed when clicking ScrollBar's arrow buttons. How do I change the ScrollBar's arrow buttons click scroll speed?