Skip to content

Instantly share code, notes, and snippets.

@DarkLotus
Created August 22, 2014 09:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarkLotus/6e550c268790e2226353 to your computer and use it in GitHub Desktop.
Save DarkLotus/6e550c268790e2226353 to your computer and use it in GitHub Desktop.
Remove default animation from Xamarin forms navigation renderer
/*
Shared implementation, use in place of NavigationPage
*/
using Xamarin.Forms;
namespace LakesEntrance
{
public class NoAnimationNavigationPage : NavigationPage
{
public NoAnimationNavigationPage(Page startupPage) :base(startupPage)
{
}
}
}
/*
Android Implementation
*/
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using System.Threading.Tasks;
using LakesEntrance.Droid;
[assembly: ExportRenderer(typeof(NoAnimationNavigationPage),typeof(NoAnimationNavigationRenderer))]
namespace MyNS.Droid
{
public class NoAnimationNavigationRenderer : NavigationRenderer
{
public NoAnimationNavigationRenderer() :base()
{
}
protected override Task<bool> OnPopViewAsync(Page page, bool animated)
{
return base.OnPopViewAsync(page, false);
}
protected override Task<bool> OnPushAsync(Page view, bool animated)
{
return base.OnPushAsync(view, false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment