private async Task AddStorage() { var viewModel = new StorageTypeDetailViewModel(new StorageViewModel(), this.storageStore, this.pageService); viewModel.StorageAdded += (source, storageType) => { //try //{ Storages.Add(new StorageViewModel(storageType)); //} //catch (Exception e) //{ // Debugger.Break(); //} }; await this.pageService.PushAsync(new StorageTypeDetailView(viewModel)); }
private async Task SelectStorage(StorageViewModel storageType) { if (storageType == null) { return; } SelectedStorage = null; var viewModel = new StorageTypeDetailViewModel(storageType, this.storageStore, this.pageService); viewModel.StorageUpdated += (source, updatedStorage) => { storageType.Id = updatedStorage.Id; storageType.StorageName = updatedStorage.StorageName; storageType.Url = updatedStorage.Url; storageType.DateAdded = updatedStorage.DateAdded; storageType.DateModified = updatedStorage.DateModified; }; await this.pageService.PushAsync(new StorageTypeDetailView(viewModel)); }