public async Task <ObservableCollection <StoreCellViewModel> > GetStores() { ObservableCollection <StoreCellViewModel> results = new ObservableCollection <StoreCellViewModel> (); try { var stores = await API.GetStores(); foreach (var store in stores) { var model = new StoreCellViewModel(); model.StoreName = store.StoreName; model.StoreId = store.StoreId; var filters = Application.Current.Properties ["StoreFilters"] as Dictionary <int, bool>; foreach (var filter in filters) { if (filter.Value) { model.On = filter.Value; } } results.Add(model); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } return(results); }
public async Task<ObservableCollection<StoreCellViewModel>> GetStores () { ObservableCollection<StoreCellViewModel> results = new ObservableCollection<StoreCellViewModel> (); try { var stores = await API.GetStores (); foreach (var store in stores) { var model = new StoreCellViewModel (); model.StoreName = store.StoreName; model.StoreId = store.StoreId; var filters = Application.Current.Properties ["StoreFilters"] as Dictionary<int,bool>; foreach (var filter in filters) { if (filter.Value) { model.On = filter.Value; } } results.Add (model); } } catch (Exception ex) { Debug.WriteLine (ex.Message); } return results; }