c# - Windows Phone 7 Development Delay on Buttons -


i have created button in c# windows phone 7 development. contains animation , when clicked want animation shown, , button navigate next page.

using thread.sleep(4000) crashes application , wondering how go this.

is there way delay navigate code?

private void batnballbtn_click(object sender, routedeventargs e) {     navigationservice.navigate(new uri("/picturegame.xaml", urikind.relative)); } 

presumably animation storyboard. can navigate within storyboard's completed event.

mystoryboard.completed += (s, e) => {     mystoryboard.stop();             navigationservice.navigate(new uri("/picturegame.xaml", urikind.relative)); }; 

this way don't need predict how long animation take, making code more reusable, , don't have worry dealing multiple threads manually.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -