示例#1
0
 public ItemsViewModel(IDataStore <Item> dataStore,
                       IApiAccessService apiAccessService)
 {
     _dataStore        = dataStore;
     _apiAccessService = apiAccessService;
     Title             = "Mentors";
     Items             = new ObservableCollection <Item>();
     Mentors           = new ObservableCollection <Mentor>();
     LoadItemsCommand  = new Command(async() => await ExecuteLoadItemsCommand());
     MessagingCenter.Subscribe <NewItemPage, Item>(this, "AddItem", async(obj,
                                                                          item) =>
     {
         var newItem = item as Item;
         Items.Add(newItem);
         await _dataStore.AddItemAsync(newItem);
     });
 }
 public MediaApiController(IApiAccessService apiAccessService)
 {
     _apiAccessService = apiAccessService;
 }