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);
            });
        }
示例#2
0
        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();
            });
        }