private async void GridView_ItemClick(object sender, ItemClickEventArgs e) { var photo = e.ClickedItem as PhotoData; object focusItem = null; if (App.IsXbox()) { focusItem = FocusManager.GetFocusedElement(); } await PhotoPreviewView.ShowAndWaitAsync(photo); // quick way to refresh binding var index = _photos.IndexOf(photo); _photos.RemoveAt(index); _photos.Insert(index, photo); if (App.IsXbox()) { (focusItem as GridViewItem).Focus(FocusState.Keyboard); } await DataProvider.Instance.SavePhotoAsync(photo); }
private async void _camera_PictureCaptured(object sender, PictureCapturedEventArgs e) { var photo = new PhotoData() { DateTime = DateTime.Now, Uri = e.File.Path, }; await _camera.StopAsync(); await PhotoPreviewView.ShowAndWaitAsync(photo); await _camera.Initialize(); var t = Task.Run(async() => { await DataProvider.Instance.SavePhotoAsync(photo); }); CameraControlsCaptureButton.IsEnabled = true; if (App.IsXbox()) { CameraControlsCaptureButton.Focus(FocusState.Keyboard); } }