Disable navigation on FlipView

2019-06-21 03:07发布

I would like to disable all navigation on my FlipView (scrolling horizontally) from user's input (e.g. mouse wheel and touch screen).

The only way the flipview is supposed to change its selected index is programatically, I have already removed the side buttons in the FlipView's style.

I tried changing some of the ScrollViewer's properties in its style but I can't manage to block everything. Anybody can hint me the correct and clean way to do this?

2条回答
The star\"
2楼-- · 2019-06-21 03:37

You can set IsEnabled property of the FlipView to False.

Hope this help!

查看更多
3楼-- · 2019-06-21 03:38

I found the solution by overriding the ControlTemplate and changing ManipulationMode in ItemsPresenter. Just place this code inside your FlipView:

<FlipView.Template>
    <ControlTemplate>
        <ItemsPresenter ManipulationMode="None"></ItemsPresenter>
    </ControlTemplate>
</FlipView.Template>

In my opinion it shouldn't be that difficult to do something simple like disabling user interaction. There should be a property to do that.

查看更多
登录 后发表回答