public async Task LoadImagesAsync() { IEnumerable <MobileServiceFile> files = await this.manager.GetImageFilesAsync(TodoItem); this.Images.Clear(); foreach (var f in files) { var todoImage = new TodoItemImage(f, this.TodoItem); this.Images.Add(todoImage); } }
public async void OnAdd(object sender, EventArgs e) { IPlatform mediaProvider = DependencyService.Get <IPlatform>(); string sourceImagePath = await mediaProvider.TakePhotoAsync(App.UIContext); if (sourceImagePath != null) { MobileServiceFile file = await this.manager.AddImage(this.TodoItem, sourceImagePath); var image = new TodoItemImage(file, this.TodoItem); this.Images.Add(image); } }