How to load the view page before executing any functions?
App Process:
1. User will click login button
2. I will navigate to sync page
3. sync page will execute six (6) functions after executing 6 functions it will redirect to my main menu page
The problem is with my number 1 and 2 process. When the user click the login button it will be stuck in my login page then go directly to my main menu page. How can I see the sync page before redirecting to main menu page.
public SyncPage (string host, string database, string contactID)
{
InitializeComponent();
new Task(SyncSetup).Start();
}
async void SyncSetup()
{
Deletedata();
InsertUserData(host, database, contactID);
InsertCAFData(host, database, contactID);
InsertContactsData(host, database, contactID);
InsertActivityData(host, database, contactID);
Device.BeginInvokeOnMainThread(() =>
{
// Assuming this function needs to use Main/UI thread to move to your "Main Menu" Page
OnSyncComplete(host, database, contactID);
});
}