internal static async void ItemClick(int id) { // Deselect current item GalleryNavigation.SetSelected(FolderIndex, false); // Change image await LoadPicAt(id).ConfigureAwait(false); await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() => { if (Properties.Settings.Default.FullscreenGallery == false) { GetPicGallery.Visibility = Visibility.Collapsed; // prevent it from popping up again // Restore interface elements if needed if (!Properties.Settings.Default.ShowInterface || Properties.Settings.Default.Fullscreen) { HideInterfaceLogic.ShowNavigation(true); HideInterfaceLogic.ShowShortcuts(true); } } // Select next item GalleryNavigation.SetSelected(id, true); })); }
internal static async void OpenHorizontalGallery() { if (Pics.Count < 1) { return; } Properties.Settings.Default.FullscreenGallery = false; GalleryLoad.LoadLayout(); AnimationHelper.Fade(GetPicGallery, TimeSpan.FromSeconds(.3), TimeSpan.Zero, 0, 1); GetClickArrowLeft.Visibility = GetClickArrowRight.Visibility = Getx2.Visibility = GetMinus.Visibility = GetRestorebutton.Visibility = GetGalleryShortcut.Visibility = Visibility.Hidden; if (GetFakeWindow != null) { if (GetFakeWindow.grid.Children.Contains(GetPicGallery)) { GetFakeWindow.grid.Children.Remove(GetPicGallery); GetMainWindow.ParentContainer.Children.Add(GetPicGallery); } } GalleryNavigation.SetSelected(FolderIndex, true); GalleryNavigation.ScrollTo(); if (GetPicGallery.Container.Children.Count == 0) { await GalleryLoad.Load().ConfigureAwait(false); } // Fix weird bug when changing folder and one item remains // TODO investigate if selected gallery item does not get removed? else if (GetPicGallery.Container.Children.Count == 1 && Pics.Count > 1) { GetPicGallery.Container.Children.Clear(); await GalleryLoad.Load().ConfigureAwait(false); } }
internal static void ItemClick(int id) { // Deselect current item GalleryNavigation.SetSelected(FolderIndex, false); // Change image Pic(id); if (Properties.Settings.Default.FullscreenGallery == false) { GetPicGallery.Visibility = Visibility.Collapsed; // prevent it from popping up again // Restore interface elements if needed if (!Properties.Settings.Default.ShowInterface || Properties.Settings.Default.Fullscreen) { HideInterfaceLogic.ShowNavigation(true); HideInterfaceLogic.ShowShortcuts(true); } } // Select next item GalleryNavigation.SetSelected(id, true); }