Skip to content

Commit 5668476

Browse files
modplugglennawatson
authored andcommitted
feature: Check for DisableAnimation attribute before PopToRootAsync (#2000)
1 parent 94369da commit 5668476

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/ReactiveUI.XamForms/RoutedViewHost.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,20 @@ public RoutedViewHost()
9999
.SelectMany(_ => PageForViewModel(Router.GetCurrentViewModel()))
100100
.SelectMany(async page =>
101101
{
102+
bool animated = true;
103+
var attribute = page.GetType().GetCustomAttribute<DisableAnimationAttribute>();
104+
if (attribute != null)
105+
{
106+
animated = false;
107+
}
108+
102109
if (popToRootPending && Navigation.NavigationStack.Count > 0)
103110
{
104111
Navigation.InsertPageBefore(page, Navigation.NavigationStack[0]);
105-
await PopToRootAsync();
112+
await PopToRootAsync(animated);
106113
}
107114
else
108115
{
109-
bool animated = true;
110-
var attribute = page.GetType().GetCustomAttribute<DisableAnimationAttribute>();
111-
if (attribute != null)
112-
{
113-
animated = false;
114-
}
115-
116116
await PushAsync(page, animated);
117117
}
118118

0 commit comments

Comments
 (0)