Created
August 22, 2014 09:00
-
-
Save DarkLotus/6e550c268790e2226353 to your computer and use it in GitHub Desktop.
Remove default animation from Xamarin forms navigation renderer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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