/// <summary> /// Save settings when closing /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal static void Window_Closing(object sender, CancelEventArgs e) { // Close Extra windows when closing if (GetFakeWindow != null) { GetFakeWindow.Close(); } GetMainWindow.Hide(); // Make it feel faster if (!Properties.Settings.Default.AutoFitWindow && !Properties.Settings.Default.Fullscreen) { Properties.Settings.Default.Top = GetMainWindow.Top; Properties.Settings.Default.Left = GetMainWindow.Left; Properties.Settings.Default.Height = GetMainWindow.Height; Properties.Settings.Default.Width = GetMainWindow.Width; } Properties.Settings.Default.Save(); FileHandling.DeleteFiles.DeleteTempFiles(); FileHandling.RecentFiles.WriteToFile(); #if DEBUG Trace.Unindent(); Trace.WriteLine("Debugging closed at " + DateTime.Now); Trace.Flush(); #endif Environment.Exit(0); }
internal static void ChangeToPicGalleryOne() { Properties.Settings.Default.PicGallery = 1; LoadLayout(); if (GetFakeWindow.grid.Children.Contains(GetPicGallery)) { GetFakeWindow.grid.Children.Remove(GetPicGallery); GetMainWindow.ParentContainer.Children.Add(GetPicGallery); } GetFakeWindow.Hide(); }
internal static void CloseFullscreenGallery() { Properties.Settings.Default.PicGallery = 1; IsOpen = false; GetFakeWindow.Hide(); ConfigureSettings.ConfigColors.UpdateColor(); HideInterfaceLogic.ShowStandardInterface(); // Restore settings AutoFitWindow = Properties.Settings.Default.AutoFitWindow; }
internal static void ChangeToHorizontalGallery() { Properties.Settings.Default.FullscreenGallery = false; GalleryLoad.LoadLayout(); if (GetFakeWindow.grid.Children.Contains(GetPicGallery)) { GetFakeWindow.grid.Children.Remove(GetPicGallery); GetMainWindow.ParentContainer.Children.Add(GetPicGallery); } GetFakeWindow.Hide(); }
internal static async void OpenFullscreenGallery(bool startup = false) { if (Pics.Count < 1 && !startup) { return; } Properties.Settings.Default.PicGallery = 2; 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 Load().ConfigureAwait(false); } }
internal static void ChangeToPicGalleryTwo() { Properties.Settings.Default.PicGallery = 2; 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(); }