0

我正在使用 WP Toolkit 在我的应用程序页面之间进行转换,它工作正常,但是在从一个页面导航到另一个页面时,我在转换之间遇到了这种奇怪的延迟,它只是显示一个空白屏幕,显然看起来不太好,没有任何过渡,它会立即打开页面,没有任何延迟或空白屏幕。这花了我将近 2 天的时间,我不知道出了什么问题,如果有人可以帮助我或建议另一个页面转换库,我将不胜感激。

(我尝试了 WP7Contrib 转换,但我有同样的问题,不确定它是我的应用程序还是库)

4

2 回答 2

3

事实上,过渡之间的背景是黑色的,为了避免这种行为,我通过在 App.Xaml.cs 中设置背景解决了这个问题

 private void InitializePhoneApplication()
    {
        if (phoneApplicationInitialized)
            return;

        // Create the frame but don't set it as RootVisual yet; this allows the splash
        // screen to remain active until the application is ready to render.
        RootFrame = new TransitionFrame();

        var brush = new ImageBrush
        {
            ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri("Images/Background.jpg", UriKind.Relative)),
            Opacity = 0.8d
        };

        RootFrame.Background = brush;

        RootFrame.Navigated += CompleteInitializePhoneApplication;

        // Handle navigation failures
        RootFrame.NavigationFailed += RootFrame_NavigationFailed;

        // Ensure we don't initialize again
        phoneApplicationInitialized = true;
    }

这样,我的所有页面都有我的背景,并且在过渡期间不再显示黑色背景。

于 2013-03-29T07:12:22.537 回答
0

我建议您在页面之间创建自己的幻灯片过渡。其实很简单。创建一个故事板,并分别在您正在导航的页面和您要进入的页面中的 onNavigatingFrom 和 onNavigatedTo 函数中播放它们。它只是为我提供了我在应用程序中想要的内容和方式。删除额外的引用会使您的代码更加优化。

于 2013-03-29T11:06:26.653 回答