C# 如何防止全景项目在windows phone 8 xaml中向右滑动?

C# 如何防止全景项目在windows phone 8 xaml中向右滑动?,c#,xaml,windows-phone-8,C#,Xaml,Windows Phone 8,我正在用XAML为Windows Phone 8应用程序制作一个教程页面。本教程是使用全景项目构建的。问题是,用户可以向右滑动并完成教程,而不必遵循教程。我想阻止这一切。到目前为止,我得到的是: private void FirstItem_ManipulationStarted(object sender, ManipulationStartedEventArgs e) { initialpoint = e.ManipulationOrigin; } pri

我正在用XAML为Windows Phone 8应用程序制作一个教程页面。本教程是使用全景项目构建的。问题是,用户可以向右滑动并完成教程,而不必遵循教程。我想阻止这一切。到目前为止,我得到的是:

private void FirstItem_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
    {
        initialpoint = e.ManipulationOrigin;
    }

 private void FirstItem_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
    {
        Point currentPosition = e.ManipulationOrigin;
        if(currentPosition.X > initialpoint.X)
        {
            // Block swipe or set item back
        }
    }
我知道他们向右转了,但我怎么能阻止呢

private void Panorama_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    //set bool tutorial_not_finished = true once tutorial is finished, false otherwise
    if (tutorial_not_finished && ((Panorama)sender).SelectedIndex == 3) //or whatever page count you have
        panoramaControl.DefaultItem = panoramaControl.Items[2]; //some else index than last
        //or you can use "panoramaControl.DefaultItem = Item2" where Item2 is the Name in appropriate PanoramaItem in xaml
}

当前没有可用的Visual Studio,因此无法测试此功能,但应足够接近。

如果“全景当前选定索引”是“全景选择更改”事件上的最后一个索引,请将“全景选定索引”设置为零。如何设置选定索引?mainPanorama.SelectedIndex仅获取,您无法设置。是的,您可以设置panorama的默认项,但要以一种巧妙的方式设置,就像mainPanorama.DefaultItem=mainPanoram.Items[index];感谢您的回复,但这仍然不起作用。因为页面已经加载完毕,所以无论默认项是什么都不重要。那么您是如何解决操纵增量事件不会干扰全景扫描的问题的?抱歉,似乎是您首先得到的。把它贴出来作为答案,我会删除我的。