Disable navigation on FlipView

落爺英雄遲暮 提交于 2019-12-10 14:16:18

问题


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?


回答1:


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.




回答2:


You can set IsEnabled property of the FlipView to False.

Hope this help!



来源:https://stackoverflow.com/questions/21991281/disable-navigation-on-flipview

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