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
Comments
Post a Comment