Esempio 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);
            }
        }
Esempio 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);
            }
        }