动画完成后切换页面

Change the page when the animation is completed

我需要在动画结束后更改 Windows Phone 的应用程序页面,但我的代码没有这样做,它只更改了页面。

  private void e(object sender, RoutedEventArgs e)
  {
      video.Begin();
      NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
  }

他们,我试试:

  private void e(object sender, RoutedEventArgs e)
  {
      video.Begin();
      video.Completed += new EventHandler(finish);
  }

  private void finish()
  {
      NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
  }

但是新的 EventHadler 给我一个问题:

 delegate System.EventHandler

 Representa el método que controlara eventos que no tienen datos de evento.

 Error: 
 Ninguna sobrecarga correspondiente a 'finish' coincide con el 'System.EventHadler' delegado

您的 finish 方法的签名有误。您必须将其更改为:

private void finish(object sender, EventArgs e)
{
    NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
}