我有以下代码:
MediaPlayer.MoveNext();
SlideTransition slideTransition = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeOut };
ITransition transition = slideTransition.GetTransition(textBlockSong);
transition.Completed += delegate { transition.Stop(); };
transition.Begin();
//would like a pause here.
SlideTransition slideTransition2 = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeIn };
ITransition transition2 = slideTransition2.GetTransition(textBlockSong);
transition2.Completed += delegate { transition2.Stop(); };
transition2.Begin();
然而,当第二部分立即开始时,第一个过渡没有机会运行。那么如何在两个转换之间添加暂停/延迟,这不会完全停止应用程序(如Thread.Sleep()
),而只是等到调用正在进行的代码?