开发者

Play splash screen only once windows phone 7

I have create an animate splash screen as Popup, I using following code to activate the Popup

        public MainPage()
    {
       开发者_JAVA技巧 InitializeComponent();
        myPopup = new Popup() { IsOpen = true, Child = new AnimatedSplashScreen() };
    }

However, when I navigate to other page and Navigate back to MainPage, the splashScreen is played again. How can I avoid this? I have setup OnNavigateTo() to IsOpen=false but no luck, I guess the event is still triggered before it's closed

Thanks for looking!


When you are navigating back, the event that handles page initialization is triggered again, and your popup instance is called no matter what properties you set for the previous page. An easy fix would be creating a global state variable and check against it before displaying the popup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜