c# - navigate to another page after Thread sleep in wp7 -


i making splash screen page. show on start of application. set thread sleep in it. unable navigate main page of application. set splashscreen page @ loading time. showing when app loaded. problem not able navigate it.

here code.

public partial class windowsphonecontrol1 : usercontrol {     public windowsphonecontrol1()     {         initializecomponent();         thread.sleep(4000);         {             navigationservice.navigate(new uri("/mainpage.xaml", urikind.relative));                 }     }     } 

you need phoneapplicationframe if you're navigating user control.

  var mypage = application.current.rootvisual phoneapplicationframe;   mypage.navigate(new uri("/mainpage.xaml", urikind.relative)); 

however, don't think best way splash screen. number of reasons, not least it's not doing useful while you're waiting.

for basic splashscreen, have image overlayed on content of mainpage.xaml, , use dispatchertimer collapse visibility of image after set period of time. allow required setup while splash screen displaying, , hide splashscreen once setup complete or time elapses.

here's decent tutorial

http://www.developer.nokia.com/community/wiki/custom_splash_screen_with_progress_bar_for_windows_phone_applications


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -