static private async Task <IEnumerable <T> > LoadData <T>(IDataSource <T> dataSource, string cacheKey) where T : BindableSchemaBase { // Read items from Cache var records = AppCache.GetItems <T>(cacheKey); if (NetworkInterface.GetIsNetworkAvailable()) { // Read items from DataSource var dsRecords = await dataSource.LoadData(); if (dsRecords != null) { AppCache.AddItems(cacheKey, dsRecords); records = dsRecords; } } return(records); }