When my app is first starting, I need to load up some previously saved data. If it exists -> then goto the TabbedPage page. Otherwise, a Login page.
I'm not sure how I can call my async method in the app's ctor or even in another method? How can I do this?
Here's my code..
namespace Foo
{
public class App : Application
{
public App()
{
Page page;
LoadStorageDataAsync(); // TODO: HALP!
if (Account != null)
{
// Lets show the dashboard.
page = new DashboardPage();
}
else
{
// We need to login to figure out who we are.
page = CreateAuthenticationPage();
}
MainPage = page;
}
... snip ...
}
So why is LoadStorageDataAsync
async? Because it's using the library PCLStorage and that is all async.