Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Created May 10, 2022 02:11
Show Gist options
  • Save rdelrosario/c6ce5a2604dd18a1ed30459f43b560c2 to your computer and use it in GitHub Desktop.
Save rdelrosario/c6ce5a2604dd18a1ed30459f43b560c2 to your computer and use it in GitHub Desktop.
public partial class HomePage : TabbedPage, IStartupTask
{
public HomePage()
{
InitializeComponent();
}
public Task<bool> CanRunAsync() => Task.FromResult(true);
public async Task<IStartupTaskParameters> RunAsync(IStartupTaskParameters parameters)
{
if (parameters.TryGetValue("Name", out var name))
{
await App.Current.MainPage.DisplayAlert("Welcome!", name?.ToString(), "Ok");
}
await App.Current.MainPage.Navigation.PushModalAsync(this);
return StartupTaskParameters.None;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment