WPF – Stop Window to move when touch scrolling

The default behaviour of the WPF touch Scrollbar moves the entire Window when reaching the end of the scrolling area.
This behaviour can be overridden by the ManipulationBoundaryFeedback event:

    <ScrollViewer PanningMode="Both" x:Name="ScrollViewer"ManipulationBoundaryFeedback="ScrollViewer_ManipulationBoundaryFeedback">
        <StackPanel Width="300">

Code behind:

        private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
            e.Handled = true;

Now to figure out a way to do this for all controls.


Handling the event on the window didn’t remove the behaviour in the application.

I had to handle the event on the first element in the window (Grid) to prevent the window to move:

    <!-- Doesn't work -->
    <Window x:Class="TestControls.BoundaryFeedback"
    Title="BoundaryFeedback" Height="300" Width="300"
    <!-- Works -->
    <Grid ManipulationBoundaryFeedback="Control_ManipulationBoundaryFeedback">



  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: