Skip to content

Instantly share code, notes, and snippets.

@ionixjunior
Created December 4, 2016 15:36
Show Gist options
  • Save ionixjunior/895400aacb5bf3e1aaf768f74d636edc to your computer and use it in GitHub Desktop.
Save ionixjunior/895400aacb5bf3e1aaf768f74d636edc to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
using Core.Interfaces;
using Core.Views;
using Xamarin.Forms;
namespace Core.Helpers
{
public class NavigationHelper : INavigationHelper
{
private bool _isNavigating = false;
public async Task GotoPage2()
{
await Navigate(new Page2View());
}
private async Task Navigate(Page page)
{
if (_isNavigating)
return;
_isNavigating = true;
await Application.Current.MainPage.Navigation.PushAsync(page);
Device.StartTimer(
TimeSpan.FromMilliseconds(500),
() => _isNavigating = false
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment