public OpportunitiesViewModel() { Task.Run(async() => { // If the database is empty, initialize the database with dummy data if (await OpportunityModelDatabase.GetNumberOfRowsAsync().ConfigureAwait(false) < 20) { await InitializeDataInDatabaseAsync().ConfigureAwait(false); } await RefreshOpportunitiesDataAsync().ConfigureAwait(false); }); }
public OpportunitiesViewModel() { MessagingCenter.Subscribe <object>(this, "RefreshData", async(sender) => { await RefreshOpportunitiesDataAsync(); }); Task.Run(async() => { // If the database is empty, initialize the database with dummy data if (await OpportunityModelDatabase.GetNumberOfRowsAsync() < 20) { await InitializeDataInDatabaseAsync(); } await RefreshOpportunitiesDataAsync(); }); }