在 FlipView 上禁用导航 [英] Disable navigation on FlipView

查看:25
本文介绍了在 FlipView 上禁用导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从用户的输入(例如鼠标滚轮和触摸屏)禁用我的 FlipView(水平滚动)上的所有导航.

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

翻转视图应该以编程方式更改其选定索引的唯一方法,我已经删除了 FlipView 样式中的侧按钮.

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.

我尝试在其样式中更改 ScrollViewer 的一些属性,但我无法阻止所有内容.任何人都可以提示我正确和干净的方法来做到这一点?

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?

推荐答案

我通过覆盖 ControlTemplate 并更改 ItemsPresenter 中的 ManipulationMode 找到了解决方案>.只需将此代码放在您的 FlipView 中:

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.

这篇关于在 FlipView 上禁用导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆