Skip to content
Permalink
Browse files

feature: Check for DisableAnimation attribute before PopToRootAsync (#…

  • Loading branch information...
modplug authored and glennawatson committed Apr 11, 2019
1 parent 94369da commit 5668476237087905bd5cf3dde2e46560ccdfd0cc
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/ReactiveUI.XamForms/RoutedViewHost.cs
@@ -99,20 +99,20 @@ public RoutedViewHost()
.SelectMany(_ => PageForViewModel(Router.GetCurrentViewModel()))
.SelectMany(async page =>
{
bool animated = true;
var attribute = page.GetType().GetCustomAttribute<DisableAnimationAttribute>();
if (attribute != null)
{
animated = false;
}

if (popToRootPending && Navigation.NavigationStack.Count > 0)
{
Navigation.InsertPageBefore(page, Navigation.NavigationStack[0]);
await PopToRootAsync();
await PopToRootAsync(animated);
}
else
{
bool animated = true;
var attribute = page.GetType().GetCustomAttribute<DisableAnimationAttribute>();
if (attribute != null)
{
animated = false;
}

await PushAsync(page, animated);
}

0 comments on commit 5668476

Please sign in to comment.
You can’t perform that action at this time.