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 OpenFullscreenGallery(bool startup = false) { if (Pics.Count < 1 && !startup) { return; } Properties.Settings.Default.FullscreenGallery = true; GalleryLoad.LoadLayout(); if (GetFakeWindow == null) { GetFakeWindow = new FakeWindow(); GetFakeWindow.grid.Children.Add(new Views.UserControls.Gallery.PicGalleryTopButtons { Margin = new Thickness(1, 12, 0, 0), }); } // Switch gallery container to the correct window if (GetMainWindow.ParentContainer.Children.Contains(GetPicGallery)) { GetMainWindow.ParentContainer.Children.Remove(GetPicGallery); GetFakeWindow.grid.Children.Add(GetPicGallery); } else if (!GetFakeWindow.grid.Children.Contains(GetPicGallery)) { GetFakeWindow.grid.Children.Add(GetPicGallery); } GetFakeWindow.Show(); GalleryNavigation.ScrollTo(); GetMainWindow.Focus(); if (!FreshStartup) { ScaleImage.TryFitImage(); } // Fix not showing up opacity bug.. VisualStateManager.GoToElementState(GetPicGallery, "Opacity", false); VisualStateManager.GoToElementState(GetPicGallery.Container, "Opacity", false); GetPicGallery.Opacity = GetPicGallery.Container.Opacity = 1; if (GetPicGallery.Container.Children.Count == 0) { await GalleryLoad.Load().ConfigureAwait(false); } }
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); }
internal static void ChangeToFullscreenGallery() { Properties.Settings.Default.FullscreenGallery = true; GalleryLoad.LoadLayout(); if (GetFakeWindow != null) { if (!GetFakeWindow.grid.Children.Contains(GetPicGallery)) { GetMainWindow.ParentContainer.Children.Remove(GetPicGallery); GetFakeWindow.grid.Children.Add(GetPicGallery); } } else { GetMainWindow.ParentContainer.Children.Remove(GetPicGallery); GetFakeWindow = new FakeWindow(); GetFakeWindow.grid.Children.Add(GetPicGallery); } GetFakeWindow.Show(); GalleryNavigation.ScrollTo(); GetMainWindow.Focus(); }