如何在windows应用商店的c#中禁用触摸屏上flipview的滑动导航
我开发了一个应用程序,其中flipview中有多个页面。 现在我只想在触摸屏上停止滑动导航。我已使用Isenabled属性,但如何在windows应用商店的c#中禁用触摸屏上flipview的滑动导航,c#,windows-store-apps,uwp,flipview,C#,Windows Store Apps,Uwp,Flipview,我开发了一个应用程序,其中flipview中有多个页面。 现在我只想在触摸屏上停止滑动导航。我已使用Isenabled属性,但 这也将禁用flipview的内容,我只是想禁用它的导航,但允许用户与它的内容交互,因为我需要拖放并放大和缩小它的内容。 请帮助我解决此问题。为了在不影响FlipView项目内容的情况下禁用FlipView on touch的滑动导航,请覆盖ControlTemplate并将操作模式更改为ItemsReseCenter中的None,并将下面的代码放入FlipView中:
这也将禁用flipview的内容,我只是想禁用它的导航,但允许用户与它的内容交互,因为我需要拖放并放大和缩小它的内容。
请帮助我解决此问题。为了在不影响FlipView项目内容的情况下禁用FlipView on touch的滑动导航,请覆盖ControlTemplate并将操作模式更改为ItemsReseCenter中的None,并将下面的代码放入FlipView中:
<FlipView.Template>
<ControlTemplate>
<ItemsPresenter ManipulationMode="None"></ItemsPresenter>
</ControlTemplate>
</FlipView.Template>
我已经对它进行了测试,它工作正常。您可以通过将操纵模式设置为TranslateX来尝试此方法,并将下面的代码放在您的FlipView中:
<FlipView.Template>
<ControlTemplate>
<ItemsPresenter ManipulationMode="None"></ItemsPresenter>
</ControlTemplate>
</FlipView.Template>
xaml:
但长官,它也会在点击按钮时停止导航
private void FlipViewItem_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (e.Delta.Translation.X != 0)
{
e.Handled = true;
}
}