C# wpf scrollviewer not working like windows store app

别说谁变了你拦得住时间么 提交于 2019-12-05 16:47:55

This is the default Windows 8 behavior related to scrolling. Your entire app will "bounce" when hitting the edge of a scroll-able view. This happens in every single cases and is part of the system animations. You can see it, for instance, in the Windows Explorer when in a long list of folders. This only happens when scrolling through touch and, if I remember correctly, on non full-screen applications. I do not currently have access to a Windows 8 machine to test this claim and there might very well be no way to disable this behavior.

The Modern environment is a completely separate application environment and does not handle touch gestures in the same way at all. This is why this behavior does not exists in a WinRT application.

EDIT : This effect is called the Manipulation Boundary Feedback. It triggers when a manipulation event goes beyond the limits of its container. You can disable it overriding the OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs) method on the affected UIElement like so:

class NoTouchFeedbackWindow : Window
{
    protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
    {
        e.Handled = true;
    }
}

This could also be done directly on your ScrollViewer or any control up the chain.

You can find more information about this behavior on:

Hopefully, this should solve your issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!