Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在windows应用商店的c#中禁用触摸屏上flipview的滑动导航_C#_Windows Store Apps_Uwp_Flipview - Fatal编程技术网

如何在windows应用商店的c#中禁用触摸屏上flipview的滑动导航

如何在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中有多个页面。 现在我只想在触摸屏上停止滑动导航。我已使用Isenabled属性,但
这也将禁用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;
        }
    }