WPF horizontal scrollbar is slow and doesn't move to click

I'm making a custom control which has a scrollviewer that can display "long" data horizontally. Think something like a video editor, or a timeline type control. I noticed two issues:
  1. If the scroll area is large, I can't click/hold/drag the thumb very far. I have to keep doing it over and over and move it a little bit each time.
  2. I can't click on the space between the thumb and and another part of the scrollbar to move the thumb to where the cursor is.
<UserControl>
    <Grid>
        <ScrollViewer
            x:Name="PART_Scroll"
            HorizontalScrollBarVisibility="Auto"
            PreviewMouseDown="OnPreviewMouseDown"
            PreviewMouseMove="OnPreviewMouseMove"
            PreviewMouseUp="OnPreviewMouseUp"
            PreviewMouseWheel="OnPreviewMouseWheel"
            VerticalScrollBarVisibility="Disabled">
            <StackPanel Orientation="Vertical">
                <Canvas
                    x:Name="TicksCanvas"
                    Height="28"
                    Background="White" />
                <Canvas
                    x:Name="BlocksSurface"
                    Height="120">
                    <!--  ItemsControl uses Canvas for positioning  -->
                    <ItemsControl
                        x:Name="PART_Items"
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <Canvas />
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                    </ItemsControl>
                </Canvas>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>
Was this page helpful?