Skip to content

Commit c260913

Browse files
committed
修复进入封面图页过渡动画的准备时机
1 parent 5183e6d commit c260913

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

PreLaunchTaskr.GUI.WinUI3/Views/AboutPage.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ private string AboutFontIcon
3131

3232
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
3333
{
34-
ConnectedAnimationService
35-
.GetForCurrentView()
36-
.PrepareToAnimate("forwardAnimation", BannerImage);
37-
3834
base.OnNavigatingFrom(e);
3935
}
4036

@@ -53,6 +49,9 @@ private void BannerImage_Tapped(object sender, Microsoft.UI.Xaml.Input.TappedRou
5349
int r = random.Next();
5450
if (r % 10 == 0 || r % 10 == 1)
5551
{
52+
ConnectedAnimationService
53+
.GetForCurrentView()
54+
.PrepareToAnimate("forwardAnimation", BannerImage);
5655
Frame.Navigate(typeof(BannerPage), null, new SuppressNavigationTransitionInfo());
5756
}
5857
}

PreLaunchTaskr.GUI.WinUI3/Views/MultiTabPage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private void TabStrip_SelectionChanged(object sender, SelectionChangedEventArgs
6565
}
6666

6767
TabStripItem item = (TabStripItem) e.AddedItems[0];
68-
ContentFrame.Navigate(item.PageType, item.ExtraData);
68+
ContentFrame.Navigate(item.PageType, item.ExtraData, new SuppressNavigationTransitionInfo());
69+
ContentFrame.BackStack.Clear();
6970
}
7071

7172
private readonly TitleBarPassthroughHelper titleBarPassthroughHelper = new(App.Current.MainWindow);

0 commit comments

Comments
 (0)