Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }