1
사용자가 내 응용 프로그램에서 페이지를 이동하면 간단한 애니메이션이 이동하기 전에 항목이 사라지게되지만 작동하지 않고 이동 중이므로 즉시 이동합니다.뒤로 키를 누르면 애니메이션이 대기하지 않습니다.
코드 : 이제
public PageClass()
{
BackKeyPress += OnBackKeyPressed;
}
void OnBackKeyPressed(object sender, CancelEventArgs e)
{
foreach (var control in ContentPanel.Children)
MainPage.FadeOutObject(control);
var translation = new TranslateTransform();
PageTitle.RenderTransform = translation;
var s = new Storyboard();
Storyboard.SetTarget(s, translation);
Storyboard.SetTargetProperty(s, new PropertyPath(TranslateTransform.YProperty));
s.Children.Add(
new DoubleAnimation()
{
From = -300,
To = 0,
Duration = new Duration(TimeSpan.FromSeconds(2.0)),
EasingFunction = new PowerEase { EasingMode = EasingMode.EaseInOut }
});
s.Begin();
s.Completed += (object sd, EventArgs ea) =>
{
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
};
}
이 그것이 바로 다시 MainPage에 간다, 작동하지 않는이 사람이 실마리가 무엇입니까?