1

I have a menu that shows up and hides with transition effects:

Open

Closed

The elements you see are navigating you to other pages.

So when i navigate to other page i do:

MenuButton.Tag = "MenuDisabled";
        VisualStateManager.GoToState(this, "HideMenu", true);
        NavigationService.Navigate(new Uri("/AboutPageAuthorized.xaml", UriKind.Relative));

But it happens that navigation is working faster than effect, so you will see it sliding till the middle and then fast dissapear - its annoying.

Is there a way to handle this effect breaking thing?

4

1 回答 1

0

在调用导航之前添加延迟,可以使用 System.Timers添加延迟, 只需在 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));
}
于 2013-07-28T20:52:48.373 回答