Silverlight 完成过渡效果
我有一个显示和隐藏带有过渡效果的菜单: 您看到的元素正在将您导航到其他页面 因此,当我导航到其他页面时,我会:Silverlight 完成过渡效果,silverlight,windows-phone-7,xaml,windows-phone-8,expression-blend,Silverlight,Windows Phone 7,Xaml,Windows Phone 8,Expression Blend,我有一个显示和隐藏带有过渡效果的菜单: 您看到的元素正在将您导航到其他页面 因此,当我导航到其他页面时,我会: MenuButton.Tag = "MenuDisabled"; VisualStateManager.GoToState(this, "HideMenu", true); NavigationService.Navigate(new Uri("/AboutPageAuthorized.xaml&qu
MenuButton.Tag = "MenuDisabled";
VisualStateManager.GoToState(this, "HideMenu", true);
NavigationService.Navigate(new Uri("/AboutPageAuthorized.xaml", UriKind.Relative));
但碰巧导航的速度比效果快,所以你会看到它一直滑到中间,然后快速消失——真烦人
有没有办法处理这种破坏效果的事情?在调用导航之前添加延迟,您可以添加延迟 只需在OnTimedEvent下添加导航事件,并根据需要调整计时器
//Place the effect here
// Create a timer with a ten second interval.
aTimer = new System.Timers.Timer(10000);
// Hook up the Elapsed event for the timer.
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Set the Interval to 2 seconds (2000 milliseconds).
aTimer.Interval = 2000;
aTimer.Enabled = true;
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
NavigationService.Navigate(new Uri("/AboutPageAuthorized.xaml", UriKind.Relative));
}