Windows Phone导航切换延迟和空白屏幕之间
本文关键字:空白 屏幕 之间 延迟 Phone 导航 Windows | 更新日期: 2023-09-27 18:06:20
我使用WP Toolkit在我的应用程序页面之间进行过渡,它工作得很好,但是在从一个页面导航到另一个页面时,我在过渡之间出现了这种奇怪的延迟,它只是显示一个空白屏幕,这显然不好看,没有任何过渡,它直接打开页面,没有任何延迟或空白屏幕。这已经花了我将近2天的时间,我不知道什么是错的,如果有人能帮助我或建议另一个页面过渡库,我将不胜感激。
(我尝试过WP7Contrib过渡,但我有同样的问题,不确定是我的应用程序或库)
事实上,过渡之间的背景是黑色的,为了避免这种行为,我通过在app . xhtml .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;
}
我所有的页面都有我的背景,黑色背景在过渡期间不再显示
我建议您在页面之间创建自己的幻灯片过渡。其实很简单。创建一个故事板,并分别在你正在导航的页面和将要进入的页面的onNavigatingFrom和onNavigatedTo函数中播放它们。它只是给了我在申请中想要的东西和方式。删除额外的引用使您的代码更加优化。