动画完成后更改页面

时间:2015-03-27 20:10:02

标签: c# windows-phone-7 windows-phone-8 windows-phone

动画完成后我需要更改我的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

1 个答案:

答案 0 :(得分:2)

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

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