Browse Source

Clean up redundancies, work on gallery, misc

Ruben 3 years ago
parent
commit
7fc1118e07
100 changed files with 1245 additions and 1116 deletions
  1. 39 41
      PicView/Animations/AnimationHelper.cs
  2. 11 8
      PicView/Animations/FadeControls.cs
  3. 5 3
      PicView/App.xaml.cs
  4. 22 21
      PicView/ChangeImage/Error_Handling.cs
  5. 5 4
      PicView/ChangeImage/FastPic.cs
  6. 10 8
      PicView/ChangeImage/History.cs
  7. 46 42
      PicView/ChangeImage/LoadPic.cs
  8. 9 7
      PicView/ChangeImage/Navigation.cs
  9. 2 3
      PicView/ChangeImage/Preloader.cs
  10. 10 7
      PicView/ChangeTitlebar/EditTitleBar.cs
  11. 6 4
      PicView/ChangeTitlebar/SetTitle.cs
  12. 26 26
      PicView/ConfigureSettings/ConfigColors.cs
  13. 34 31
      PicView/ConfigureSettings/UpdateUIValues.cs
  14. 10 8
      PicView/Editing/Color_Picking.cs
  15. 2 2
      PicView/Editing/Crop/CropContextMenu.cs
  16. 10 10
      PicView/Editing/Crop/CropFunctions.cs
  17. 5 4
      PicView/Editing/Crop/CropService.cs
  18. 2 2
      PicView/Editing/Crop/State/CreateState.cs
  19. 2 2
      PicView/Editing/Crop/State/DragState.cs
  20. 3 2
      PicView/Editing/Crop/Tools/TextTool.cs
  21. 56 57
      PicView/Editing/ShaderEffects/Hlsl.cs
  22. 12 10
      PicView/FileHandling/ArchiveExtraction.cs
  23. 10 8
      PicView/FileHandling/Copy-paste.cs
  24. 8 7
      PicView/FileHandling/DeleteFiles.cs
  25. 23 20
      PicView/FileHandling/FileFunctions.cs
  26. 11 10
      PicView/FileHandling/FileLists.cs
  27. 11 10
      PicView/FileHandling/Open_Save.cs
  28. 4 4
      PicView/FileHandling/WebFunctions.cs
  29. 4 4
      PicView/GlobalSuppressions.cs
  30. 6 5
      PicView/ImageHandling/Base64.cs
  31. 3 7
      PicView/ImageHandling/BatchFunctions.cs
  32. 21 17
      PicView/ImageHandling/GetImageData.cs
  33. 12 9
      PicView/ImageHandling/ImageDecoder.cs
  34. 22 17
      PicView/ImageHandling/ImageFunctions.cs
  35. 4 3
      PicView/ImageHandling/ImageSizeFunctions.cs
  36. 6 5
      PicView/ImageHandling/SaveImages.cs
  37. 7 7
      PicView/ImageHandling/Thumbnails.cs
  38. 20 15
      PicView/PicGallery/GalleryClick.cs
  39. 7 7
      PicView/PicGallery/GalleryFunctions.cs
  40. 15 11
      PicView/PicGallery/GalleryLoad.cs
  41. 19 23
      PicView/PicGallery/GalleryNavigation.cs
  42. 35 36
      PicView/PicGallery/GalleryToggle.cs
  43. 4 3
      PicView/ProcessHandling/ProcessLogic.cs
  44. 20 15
      PicView/Properties/Resources.Designer.cs
  45. 157 151
      PicView/Properties/Settings.Designer.cs
  46. 4 3
      PicView/Shortcuts/CustomTextBoxShortcuts.cs
  47. 2 3
      PicView/Shortcuts/GenericWindowShortcuts.cs
  48. 38 38
      PicView/Shortcuts/MainKeyboardShortcuts.cs
  49. 19 19
      PicView/Shortcuts/MainMouseKeys.cs
  50. 11 9
      PicView/Shortcuts/QuickResizeShortcuts.cs
  51. 3 1
      PicView/SystemIntegration/MonitorSize.cs
  52. 12 10
      PicView/SystemIntegration/NativeMethods.cs
  53. 9 7
      PicView/SystemIntegration/Taskbar.cs
  54. 9 10
      PicView/SystemIntegration/Wallpaper.cs
  55. 3 2
      PicView/Themes/Resources/DrawingBrushes.cs
  56. 5 4
      PicView/Translations/LoadLanguage.cs
  57. 12 10
      PicView/UILogic/ConfigureWindows.cs
  58. 8 6
      PicView/UILogic/DragAndDrop/DragToExplorer.cs
  59. 13 10
      PicView/UILogic/DragAndDrop/Image_DragAndDrop.cs
  60. 11 8
      PicView/UILogic/HideInterfaceLogic.cs
  61. 9 8
      PicView/UILogic/ImageInfo.cs
  62. 40 34
      PicView/UILogic/Loading/LoadContextMenus.cs
  63. 11 14
      PicView/UILogic/Loading/LoadControls.cs
  64. 19 16
      PicView/UILogic/Loading/StartLoading.cs
  65. 30 25
      PicView/UILogic/Sizing/ScaleImage.cs
  66. 59 51
      PicView/UILogic/Sizing/WindowSizing.cs
  67. 10 8
      PicView/UILogic/Slideshow.cs
  68. 5 3
      PicView/UILogic/Timers.cs
  69. 2 2
      PicView/UILogic/Tooltip.cs
  70. 9 7
      PicView/UILogic/TransformImage/Rotation.cs
  71. 8 5
      PicView/UILogic/TransformImage/Scroll.cs
  72. 6 6
      PicView/UILogic/TransformImage/Zoom.cs
  73. 7 6
      PicView/UILogic/UC.cs
  74. 4 3
      PicView/Views/UserControls/Buttons/BackgroundButton.xaml.cs
  75. 2 2
      PicView/Views/UserControls/Buttons/ClickArrow.xaml.cs
  76. 4 4
      PicView/Views/UserControls/Buttons/CloseButton.xaml.cs
  77. 5 4
      PicView/Views/UserControls/Buttons/CopyButton.xaml.cs
  78. 4 3
      PicView/Views/UserControls/Buttons/FlipButton.xaml.cs
  79. 2 2
      PicView/Views/UserControls/Buttons/FolderButton.xaml.cs
  80. 7 6
      PicView/Views/UserControls/Buttons/FullscreenButton.xaml.cs
  81. 2 2
      PicView/Views/UserControls/Buttons/GalleryShortcut.xaml.cs
  82. 11 9
      PicView/Views/UserControls/Buttons/GoToPicButton.xaml.cs
  83. 5 4
      PicView/Views/UserControls/Buttons/ImageInfoButton.xaml.cs
  84. 4 3
      PicView/Views/UserControls/Buttons/InfoButton.xaml.cs
  85. 2 2
      PicView/Views/UserControls/Buttons/LefttButton.xaml.cs
  86. 5 4
      PicView/Views/UserControls/Buttons/LinkButton.xaml.cs
  87. 5 4
      PicView/Views/UserControls/Buttons/MenuCloseButton.xaml.cs
  88. 4 4
      PicView/Views/UserControls/Buttons/MinButton.xaml.cs
  89. 4 3
      PicView/Views/UserControls/Buttons/Minus.xaml.cs
  90. 4 3
      PicView/Views/UserControls/Buttons/OptimizeButton.xaml.cs
  91. 5 4
      PicView/Views/UserControls/Buttons/PasteButton.xaml.cs
  92. 5 4
      PicView/Views/UserControls/Buttons/RecycleButton.xaml.cs
  93. 5 4
      PicView/Views/UserControls/Buttons/ReloadButton.xaml.cs
  94. 5 4
      PicView/Views/UserControls/Buttons/ResizeButton.xaml.cs
  95. 6 4
      PicView/Views/UserControls/Buttons/RestoreButton.xaml.cs
  96. 2 2
      PicView/Views/UserControls/Buttons/RightButton.xaml.cs
  97. 4 3
      PicView/Views/UserControls/Buttons/RotateLeftButton.xaml.cs
  98. 4 3
      PicView/Views/UserControls/Buttons/RotateRightButton.xaml.cs
  99. 2 2
      PicView/Views/UserControls/Buttons/SettingsButton.xaml.cs
  100. 3 3
      PicView/Views/UserControls/Buttons/SlideshowButton.xaml.cs

+ 39 - 41
PicView/Animations/AnimationHelper.cs

@@ -1,9 +1,8 @@
-using PicView.ChangeImage;
-using PicView.Views.UserControls;
-using System;
+using System;
 using System.Windows;
 using System.Windows.Media;
 using System.Windows.Media.Animation;
+using PicView.Properties;
 
 namespace PicView.Animations
 {
@@ -27,7 +26,6 @@ namespace PicView.Animations
             }
             catch (Exception)
             {
-                return;
             }
         }
 
@@ -107,18 +105,18 @@ namespace PicView.Animations
         {
             colorAnimation.From = colortheme switch
             {
-                2 => Properties.Settings.Default.Pink,
-                3 => Properties.Settings.Default.Orange,
-                4 => Properties.Settings.Default.Green,
-                5 => Properties.Settings.Default.Red,
-                6 => Properties.Settings.Default.Teal,
-                7 => Properties.Settings.Default.Aqua,
-                8 => Properties.Settings.Default.Golden,
-                9 => Properties.Settings.Default.Purple,
-                10 => Properties.Settings.Default.Cyan,
-                11 => Properties.Settings.Default.Magenta,
-                12 => Properties.Settings.Default.Lime,
-                _ => Properties.Settings.Default.Blue,
+                2 => Settings.Default.Pink,
+                3 => Settings.Default.Orange,
+                4 => Settings.Default.Green,
+                5 => Settings.Default.Red,
+                6 => Settings.Default.Teal,
+                7 => Settings.Default.Aqua,
+                8 => Settings.Default.Golden,
+                9 => Settings.Default.Purple,
+                10 => Settings.Default.Cyan,
+                11 => Settings.Default.Magenta,
+                12 => Settings.Default.Lime,
+                _ => Settings.Default.Blue,
             };
             colorAnimation.To = Color.FromArgb(a, r, g, b);
             brush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
@@ -129,18 +127,18 @@ namespace PicView.Animations
             colorAnimation.From = Color.FromArgb(a, r, g, b);
             colorAnimation.To = colortheme switch
             {
-                2 => Properties.Settings.Default.Pink,
-                3 => Properties.Settings.Default.Orange,
-                4 => Properties.Settings.Default.Green,
-                5 => Properties.Settings.Default.Red,
-                6 => Properties.Settings.Default.Teal,
-                7 => Properties.Settings.Default.Aqua,
-                8 => Properties.Settings.Default.Golden,
-                9 => Properties.Settings.Default.Purple,
-                10 => Properties.Settings.Default.Cyan,
-                11 => Properties.Settings.Default.Magenta,
-                12 => Properties.Settings.Default.Lime,
-                _ => Properties.Settings.Default.Blue,
+                2 => Settings.Default.Pink,
+                3 => Settings.Default.Orange,
+                4 => Settings.Default.Green,
+                5 => Settings.Default.Red,
+                6 => Settings.Default.Teal,
+                7 => Settings.Default.Aqua,
+                8 => Settings.Default.Golden,
+                9 => Settings.Default.Purple,
+                10 => Settings.Default.Cyan,
+                11 => Settings.Default.Magenta,
+                12 => Settings.Default.Lime,
+                _ => Settings.Default.Blue,
             };
             brush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
         }
@@ -153,20 +151,20 @@ namespace PicView.Animations
 
         internal static Color GetPrefferedColor()
         {
-            return Properties.Settings.Default.ColorTheme switch
+            return Settings.Default.ColorTheme switch
             {
-                2 => Properties.Settings.Default.Pink,
-                3 => Properties.Settings.Default.Orange,
-                4 => Properties.Settings.Default.Green,
-                5 => Properties.Settings.Default.Red,
-                6 => Properties.Settings.Default.Teal,
-                7 => Properties.Settings.Default.Aqua,
-                8 => Properties.Settings.Default.Golden,
-                9 => Properties.Settings.Default.Purple,
-                10 => Properties.Settings.Default.Cyan,
-                11 => Properties.Settings.Default.Magenta,
-                12 => Properties.Settings.Default.Lime,
-                _ => Properties.Settings.Default.Blue,
+                2 => Settings.Default.Pink,
+                3 => Settings.Default.Orange,
+                4 => Settings.Default.Green,
+                5 => Settings.Default.Red,
+                6 => Settings.Default.Teal,
+                7 => Settings.Default.Aqua,
+                8 => Settings.Default.Golden,
+                9 => Settings.Default.Purple,
+                10 => Settings.Default.Cyan,
+                11 => Settings.Default.Magenta,
+                12 => Settings.Default.Lime,
+                _ => Settings.Default.Blue,
             };
         }
 

+ 11 - 8
PicView/Animations/FadeControls.cs

@@ -1,9 +1,12 @@
-using PicView.PicGallery;
-using PicView.UILogic;
-using PicView.UILogic.TransformImage;
-using System;
+using System;
 using System.Threading.Tasks;
 using System.Timers;
+using System.Windows.Controls.Primitives;
+using System.Windows.Threading;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.UILogic.TransformImage;
 using static PicView.UILogic.UC;
 
 namespace PicView.Animations
@@ -21,7 +24,7 @@ namespace PicView.Animations
         /// <param name="show"></param>
         internal static async Task FadeAsync(bool show)
         {
-            if (Properties.Settings.Default.ShowInterface && Properties.Settings.Default.Fullscreen == false
+            if (Settings.Default.ShowInterface && Settings.Default.Fullscreen == false
                 || GetClickArrowRight == null
                 || GetClickArrowLeft == null
                 || Getx2 == null
@@ -34,7 +37,7 @@ namespace PicView.Animations
                 return;
             }
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, (Action)(() =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)(() =>
             {
                 if (GetCropppingTool != null)
                 {
@@ -44,7 +47,7 @@ namespace PicView.Animations
                     }
                 }
 
-                if (Properties.Settings.Default.ScrollEnabled && ConfigureWindows.GetMainWindow?.Scroller?.ScrollableHeight > 0)
+                if (Settings.Default.ScrollEnabled && ConfigureWindows.GetMainWindow?.Scroller?.ScrollableHeight > 0)
                 {
                     ScrollbarFade(show);
                 }
@@ -85,7 +88,7 @@ namespace PicView.Animations
         /// <param name="show"></param>
         internal static void ScrollbarFade(bool show)
         {
-            var s = ConfigureWindows.GetMainWindow?.Scroller?.Template?.FindName("PART_VerticalScrollBar", ConfigureWindows.GetMainWindow?.Scroller) as System.Windows.Controls.Primitives.ScrollBar;
+            var s = ConfigureWindows.GetMainWindow?.Scroller?.Template?.FindName("PART_VerticalScrollBar", ConfigureWindows.GetMainWindow?.Scroller) as ScrollBar;
 
             if (show)
             {

+ 5 - 3
PicView/App.xaml.cs

@@ -1,4 +1,6 @@
-using System.Windows;
+using System.Runtime;
+using System.Windows;
+using PicView.FileHandling;
 
 namespace PicView
 {
@@ -9,8 +11,8 @@ namespace PicView
     {
         protected override void OnStartup(StartupEventArgs e)
         {
-            System.Runtime.ProfileOptimization.SetProfileRoot(FileHandling.FileFunctions.GetWritingPath());
-            System.Runtime.ProfileOptimization.StartProfile("ProfileOptimization");
+            ProfileOptimization.SetProfileRoot(FileFunctions.GetWritingPath());
+            ProfileOptimization.StartProfile("ProfileOptimization");
         }
     }
 }

+ 22 - 21
PicView/ChangeImage/Error_Handling.cs

@@ -1,13 +1,15 @@
-using PicView.FileHandling;
-using PicView.ImageHandling;
-using PicView.PicGallery;
-using PicView.UILogic;
-using PicView.UILogic.Sizing;
-using System;
+using System;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Threading;
+using PicView.FileHandling;
+using PicView.ImageHandling;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.SystemIntegration;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
 using static PicView.ChangeImage.Navigation;
 using static PicView.FileHandling.DeleteFiles;
 
@@ -21,7 +23,7 @@ namespace PicView.ChangeImage
         /// <returns></returns>
         internal static bool CheckOutOfRange()
         {
-            return Pics?.Count < FolderIndex || Pics?.Count < 1 || UILogic.UC.GetCropppingTool is { IsVisible: true };
+            return Pics?.Count < FolderIndex || Pics?.Count < 1 || UC.GetCropppingTool is { IsVisible: true };
         }
 
         internal static void UnexpectedError()
@@ -60,7 +62,7 @@ namespace PicView.ChangeImage
 
             if (UC.GetPicGallery is null || folderChanged is false) { return folderChanged; }
             
-            if (Properties.Settings.Default.FullscreenGalleryHorizontal || Properties.Settings.Default.FullscreenGalleryVertical)
+            if (Settings.Default.FullscreenGalleryHorizontal || Settings.Default.FullscreenGalleryVertical)
             {
                 await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() =>
                 {
@@ -88,11 +90,12 @@ namespace PicView.ChangeImage
             {
                 return "web";
             }
-            else if (Base64.IsBase64String(s))
+
+            if (Base64.IsBase64String(s))
             {
                 return "base64";
             }
-            
+
             s = s.Replace("\"", "");
             s = s.Trim();
 
@@ -101,14 +104,12 @@ namespace PicView.ChangeImage
                 return s;
             }
 
-            else if (Directory.Exists(s))
+            if (Directory.Exists(s))
             {
                 return "directory";
             }
-            else
-            {
-                return string.Empty;
-            }
+
+            return string.Empty;
         }
 
         /// <summary>
@@ -163,11 +164,11 @@ namespace PicView.ChangeImage
             else if (CheckOutOfRange() == false)
             {
                 // Determine if browsing directories recursively or only update from single directory
-                if (string.IsNullOrWhiteSpace(Navigation.InitialPath) == false
-                    && Properties.Settings.Default.IncludeSubDirectories
-                    && Path.GetDirectoryName(Navigation.InitialPath) != Path.GetDirectoryName(Pics[FolderIndex]))
+                if (string.IsNullOrWhiteSpace(InitialPath) == false
+                    && Settings.Default.IncludeSubDirectories
+                    && Path.GetDirectoryName(InitialPath) != Path.GetDirectoryName(Pics[FolderIndex]))
                 {
-                    path = Navigation.InitialPath;
+                    path = InitialPath;
                 }
                 else
                 {
@@ -183,7 +184,7 @@ namespace PicView.ChangeImage
 
                 if (path == (string)Application.Current.Resources["Loading"])
                 {
-                    path = Navigation.InitialPath;
+                    path = InitialPath;
                 }
             }
 
@@ -288,7 +289,7 @@ namespace PicView.ChangeImage
 
             try
             {
-                _ = SystemIntegration.Taskbar.NoProgress();
+                _ = Taskbar.NoProgress();
             }
             catch
             {

+ 5 - 4
PicView/ChangeImage/FastPic.cs

@@ -1,21 +1,22 @@
-using PicView.ImageHandling;
-using System.IO;
+using System.IO;
 using System.Threading.Tasks;
+using System.Timers;
 using System.Windows.Media.Imaging;
+using PicView.ImageHandling;
 using static PicView.ChangeImage.Navigation;
 
 namespace PicView.ChangeImage
 {
     internal static class FastPic
     {
-        static System.Timers.Timer? timer;
+        static Timer? timer;
         static bool updateSource;
 
         internal static async Task Run(int index)
         {
             if (timer is null)
             {
-                timer = new System.Timers.Timer(450)
+                timer = new Timer(450)
                 {
                     AutoReset = false,
                     Enabled = true

+ 10 - 8
PicView/ChangeImage/History.cs

@@ -1,5 +1,4 @@
-using PicView.FileHandling;
-using PicView.UILogic;
+using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
@@ -8,6 +7,9 @@ using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
+using System.Windows.Threading;
+using PicView.FileHandling;
+using PicView.UILogic;
 
 namespace PicView.ChangeImage
 {
@@ -29,7 +31,7 @@ namespace PicView.ChangeImage
                 {
                     listToRead = new StreamReader(path);
                 }
-                catch (System.Exception)
+                catch (Exception)
                 {
                     return; // Putting in try catch prevents error when file list is empty
                 }
@@ -51,7 +53,7 @@ namespace PicView.ChangeImage
                     using FileStream fs = File.Create(path);
                     fs.Seek(0, SeekOrigin.Begin);
                 }
-                catch (System.Exception)
+                catch (Exception)
                 {
                     return;
                 }
@@ -86,7 +88,7 @@ namespace PicView.ChangeImage
                 // Close the stream and reclaim memory
                 streamWriter.Close();
             }
-            catch (System.Exception)
+            catch (Exception)
             {
                 // Putting in try catch prevents error when file list is empty
             }
@@ -104,7 +106,7 @@ namespace PicView.ChangeImage
                 return;
             }
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
                 UC.ToggleStartUpUC(true);
             });
@@ -190,7 +192,7 @@ namespace PicView.ChangeImage
             }
             else
             {
-                selected = filePath == ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex];
+                selected = filePath == Navigation.Pics[Navigation.FolderIndex];
             }
 
             var mainColor = (SolidColorBrush)Application.Current.Resources["MainColorBrush"];
@@ -208,7 +210,7 @@ namespace PicView.ChangeImage
             var header = Path.GetFileNameWithoutExtension(filePath);
             header = header.Length > 30 ? FileFunctions.Shorten(header, 30) : header;
 
-            var menuItem = new MenuItem()
+            var menuItem = new MenuItem
             {
                 Header = header,
                 ToolTip = filePath,

+ 46 - 42
PicView/ChangeImage/LoadPic.cs

@@ -1,14 +1,17 @@
-using PicView.FileHandling;
-using PicView.ImageHandling;
-using PicView.PicGallery;
-using PicView.SystemIntegration;
-using PicView.UILogic;
-using System;
+using System;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media.Imaging;
 using System.Windows.Threading;
+using PicView.FileHandling;
+using PicView.ImageHandling;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.SystemIntegration;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
+using XamlAnimatedGif;
 using static PicView.ChangeImage.ErrorHandling;
 using static PicView.ChangeImage.Navigation;
 using static PicView.FileHandling.ArchiveExtraction;
@@ -18,6 +21,7 @@ using static PicView.UILogic.SetTitle;
 using static PicView.UILogic.Sizing.ScaleImage;
 using static PicView.UILogic.Tooltip;
 using static PicView.UILogic.UC;
+using Rotation = PicView.UILogic.TransformImage.Rotation;
 
 namespace PicView.ChangeImage
 {
@@ -33,11 +37,11 @@ namespace PicView.ChangeImage
         {
             if (File.Exists(file) == false)
             {
-                if (Properties.Settings.Default.AutoFitWindow)
+                if (Settings.Default.AutoFitWindow)
                 {
                     await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                     {
-                        UILogic.Sizing.WindowSizing.SetWindowBehavior();
+                        WindowSizing.SetWindowBehavior();
                     });
                 }
                 await LoadPicFromStringAsync(file, false).ConfigureAwait(false);
@@ -76,7 +80,7 @@ namespace PicView.ChangeImage
                     {
                         if (fileInfo.Extension == ".gif")
                         {
-                            XamlAnimatedGif.AnimationBehavior.SetSourceUri(ConfigureWindows.GetMainWindow.MainImage, new Uri(fileInfo.FullName));
+                            AnimationBehavior.SetSourceUri(ConfigureWindows.GetMainWindow.MainImage, new Uri(fileInfo.FullName));
                         }
                         else
                         {
@@ -138,7 +142,7 @@ namespace PicView.ChangeImage
         {
             ConfigureWindows.GetMainWindow.Dispatcher.Invoke(DispatcherPriority.Render, () =>
             {
-                UC.ToggleStartUpUC(true);
+                ToggleStartUpUC(true);
             });
 
             if (checkExists && File.Exists(path))
@@ -159,13 +163,13 @@ namespace PicView.ChangeImage
                     SetLoadingString();
                 });
 
-                string check = ErrorHandling.CheckIfLoadableString(path);
+                string check = CheckIfLoadableString(path);
                 switch (check)
                 {
-                    default: await LoadPic.LoadPiFromFileAsync(check).ConfigureAwait(false); return;
+                    default: await LoadPiFromFileAsync(check).ConfigureAwait(false); return;
                     case "web": await WebFunctions.PicWeb(path).ConfigureAwait(false); return;
-                    case "base64": await LoadPic.LoadBase64PicAsync(path).ConfigureAwait(false); return;
-                    case "directory": await LoadPic.LoadPicFromFolderAsync(path).ConfigureAwait(false); return;
+                    case "base64": await LoadBase64PicAsync(path).ConfigureAwait(false); return;
+                    case "directory": await LoadPicFromFolderAsync(path).ConfigureAwait(false); return;
                     case "": ConfigureWindows.GetMainWindow.Dispatcher.Invoke(DispatcherPriority.Render, () => { Unload(true); }); return;
                 }
             }
@@ -189,7 +193,7 @@ namespace PicView.ChangeImage
         {
             await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, () =>
             {
-                UC.ToggleStartUpUC(true);
+                ToggleStartUpUC(true);
             });
 
             if (fileInfo.Exists == false)
@@ -210,8 +214,8 @@ namespace PicView.ChangeImage
 
             LoadingPreview(fileInfo);
 
-            bool folderChanged = await ErrorHandling.CheckDirectoryChangeAndPicGallery(fileInfo).ConfigureAwait(false);
-            await FileLists.RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
+            bool folderChanged = await CheckDirectoryChangeAndPicGallery(fileInfo).ConfigureAwait(false);
+            await RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
 
             if (Pics?.Count > 0)
             {
@@ -257,7 +261,7 @@ namespace PicView.ChangeImage
             var fileInfo = new FileInfo(folder);
             if (fileInfo is null)
             {
-                ErrorHandling.UnexpectedError();
+                UnexpectedError();
                 return;
             }
 
@@ -274,26 +278,26 @@ namespace PicView.ChangeImage
             await ConfigureWindows.GetMainWindow.Dispatcher.InvokeAsync(() =>
             {
                 SetLoadingString();
-                UC.ToggleStartUpUC(true);
+                ToggleStartUpUC(true);
             });
 
-            if (ErrorHandling.CheckOutOfRange() == false)
+            if (CheckOutOfRange() == false)
             {
                 BackupPath = Pics[FolderIndex];
             }
 
-            bool folderChanged = await ErrorHandling.CheckDirectoryChangeAndPicGallery(fileInfo).ConfigureAwait(false);
+            bool folderChanged = await CheckDirectoryChangeAndPicGallery(fileInfo).ConfigureAwait(false);
 
             if (FreshStartup is false || folderChanged)
             {
                 Preloader.Clear();
             }
 
-            await FileLists.RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
+            await RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
 
             if (Pics.Count < 0) // TODO make function to find first folder with pics, when not browsing recursively
             {
-                await ErrorHandling.ReloadAsync(true).ConfigureAwait(false);
+                await ReloadAsync(true).ConfigureAwait(false);
                 return;
             }
 
@@ -338,7 +342,7 @@ namespace PicView.ChangeImage
             }
 
             FolderIndex = index;
-            var preloadValue = Preloader.Get(Navigation.Pics[index]);
+            var preloadValue = Preloader.Get(Pics[index]);
 
             // Initate loading behavior, if needed
             if (preloadValue == null || preloadValue.IsLoading)
@@ -362,13 +366,13 @@ namespace PicView.ChangeImage
                         {
                             var x = index - 1 >= 0 ? index - 1 : 0;
                             fileInfo = new FileInfo(Pics[x]);
-                            await FileLists.RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
+                            await RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
                             await LoadPiFromFileAsync(fileInfo).ConfigureAwait(false);
                             return;
                         }
                         catch (Exception)
                         {
-                            ErrorHandling.UnexpectedError();
+                            UnexpectedError();
                             return;
                         }
                     }
@@ -404,10 +408,10 @@ namespace PicView.ChangeImage
 
                 if (preloadValue is null)
                 {
-                    bool added = await Preloader.AddAsync(index, fileInfo, null).ConfigureAwait(false);
+                    bool added = await Preloader.AddAsync(index, fileInfo).ConfigureAwait(false);
                     if (added)
                     {
-                        preloadValue = Preloader.Get(Navigation.Pics[index]);
+                        preloadValue = Preloader.Get(Pics[index]);
                     }
 
                     if (preloadValue is null)
@@ -528,22 +532,22 @@ namespace PicView.ChangeImage
                     bitmapSource = ImageFunctions.ImageErrorMessage();
                     if (bitmapSource is null)
                     {
-                        ErrorHandling.UnexpectedError();
+                        UnexpectedError();
                         return;
                     }
                 }
 
                 // Scroll to top if scroll enabled
-                if (Properties.Settings.Default.ScrollEnabled)
+                if (Settings.Default.ScrollEnabled)
                 {
                     ConfigureWindows.GetMainWindow.Scroller.ScrollToTop();
                 }
 
                 // Reset transforms if needed
-                if (UILogic.TransformImage.Rotation.Flipped || UILogic.TransformImage.Rotation.Rotateint != 0)
+                if (Rotation.Flipped || Rotation.Rotateint != 0)
                 {
-                    UILogic.TransformImage.Rotation.Flipped = false;
-                    UILogic.TransformImage.Rotation.Rotateint = 0;
+                    Rotation.Flipped = false;
+                    Rotation.Rotateint = 0;
                     if (GetQuickSettingsMenu is not null && GetQuickSettingsMenu.FlipButton is not null)
                     {
                         GetQuickSettingsMenu.FlipButton.TheButton.IsChecked = false;
@@ -556,7 +560,7 @@ namespace PicView.ChangeImage
                 string? ext = fileInfo is null ? Path.GetExtension(Pics?[index]) : fileInfo.Extension;
                 if (ext is not null && ext.Equals(".gif", StringComparison.OrdinalIgnoreCase))
                 {
-                    XamlAnimatedGif.AnimationBehavior.SetSourceUri(ConfigureWindows.GetMainWindow.MainImage, new Uri(Pics?[index]));
+                    AnimationBehavior.SetSourceUri(ConfigureWindows.GetMainWindow.MainImage, new Uri(Pics?[index]));
                 }
                 else
                 {
@@ -579,7 +583,7 @@ namespace PicView.ChangeImage
             {
                 Unload(false);
 
-                if (Properties.Settings.Default.ScrollEnabled)
+                if (Settings.Default.ScrollEnabled)
                 {
                     ConfigureWindows.GetMainWindow.Scroller.ScrollToTop();
                 }
@@ -591,7 +595,7 @@ namespace PicView.ChangeImage
 
                 CloseToolTipMessage();
 
-                UC.ToggleStartUpUC(true);
+                ToggleStartUpUC(true);
             });
 
             _ = Taskbar.NoProgress().ConfigureAwait(false);
@@ -609,14 +613,14 @@ namespace PicView.ChangeImage
         {
             ConfigureWindows.GetMainWindow.Dispatcher.Invoke(DispatcherPriority.Render, () =>
             {
-                SetTitle.SetLoadingString();
+                SetLoadingString();
             });
 
             UpdatePic(imageName, bitmap);
 
             ConfigureWindows.GetMainWindow.Dispatcher.Invoke(DispatcherPriority.Render, () =>
             {
-                UC.ToggleStartUpUC(true);
+                ToggleStartUpUC(true);
             });
         }
 
@@ -632,9 +636,9 @@ namespace PicView.ChangeImage
 
             await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, async () =>
             {
-                UC.ToggleStartUpUC(true);
+                ToggleStartUpUC(true);
 
-                if (Properties.Settings.Default.ScrollEnabled)
+                if (Settings.Default.ScrollEnabled)
                 {
                     ConfigureWindows.GetMainWindow.Scroller.ScrollToTop();
                 }
@@ -647,7 +651,7 @@ namespace PicView.ChangeImage
                         FitImage(imageSize.Value.Width, imageSize.Value.Height);
                         SetTitleString((int)imageSize.Value.Width, (int)imageSize.Value.Height, imageName);
                     }
-                    XamlAnimatedGif.AnimationBehavior.SetSourceUri(ConfigureWindows.GetMainWindow.MainImage, new Uri(file));
+                    AnimationBehavior.SetSourceUri(ConfigureWindows.GetMainWindow.MainImage, new Uri(file));
                 }
                 else if (bitmapSource != null)
                 {
@@ -657,7 +661,7 @@ namespace PicView.ChangeImage
                 }
                 else
                 {
-                    ErrorHandling.UnexpectedError();
+                    UnexpectedError();
                     return;
                 }
 

+ 9 - 7
PicView/ChangeImage/Navigation.cs

@@ -1,6 +1,8 @@
-using PicView.PicGallery;
-using PicView.UILogic;
+using System.Collections.Generic;
 using System.Threading.Tasks;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.UILogic;
 
 namespace PicView.ChangeImage
 {
@@ -11,7 +13,7 @@ namespace PicView.ChangeImage
         /// <summary>
         /// List of file paths to supported files
         /// </summary>
-        internal static System.Collections.Generic.List<string>? Pics { get; set; }
+        internal static List<string>? Pics { get; set; }
 
         /// <summary>
         /// Counter used to get current index
@@ -116,7 +118,7 @@ namespace PicView.ChangeImage
                 if (forward)
                 {
                     // loop next
-                    if (Properties.Settings.Default.Looping || Slideshow.SlideTimer != null && Slideshow.SlideTimer.Enabled)
+                    if (Settings.Default.Looping || Slideshow.SlideTimer != null && Slideshow.SlideTimer.Enabled)
                     {
                         next = FolderIndex == Pics?.Count - 1 ? 0 : FolderIndex + 1;
                     }
@@ -135,7 +137,7 @@ namespace PicView.ChangeImage
                 else
                 {
                     // Loop prev
-                    if (Properties.Settings.Default.Looping || Slideshow.SlideTimer != null && Slideshow.SlideTimer.Enabled)
+                    if (Settings.Default.Looping || Slideshow.SlideTimer != null && Slideshow.SlideTimer.Enabled)
                     {
                         next = FolderIndex == 0 ? Pics.Count - 1 : FolderIndex - 1;
                     }
@@ -185,7 +187,7 @@ namespace PicView.ChangeImage
                 else
                 {
                     LeftbuttonClicked = true;
-                    await NavigateToPicAsync(false, false).ConfigureAwait(false);
+                    await NavigateToPicAsync(false).ConfigureAwait(false);
                 }
             }
             else // Alternative interface buttons
@@ -203,7 +205,7 @@ namespace PicView.ChangeImage
                 else
                 {
                     ClickArrowLeftClicked = true;
-                    await NavigateToPicAsync(false, false).ConfigureAwait(false);
+                    await NavigateToPicAsync(false).ConfigureAwait(false);
                 }
             }
         }

+ 2 - 3
PicView/ChangeImage/Preloader.cs

@@ -1,10 +1,10 @@
-using PicView.ImageHandling;
-using System;
+using System;
 using System.Collections.Concurrent;
 using System.Diagnostics;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows.Media.Imaging;
+using PicView.ImageHandling;
 using static PicView.ChangeImage.Navigation;
 
 namespace PicView.ChangeImage
@@ -104,7 +104,6 @@ namespace PicView.ChangeImage
             catch (Exception e)
             {
                 Trace.WriteLine("Preloader " + nameof(Remove) + "exception" + Environment.NewLine + e.Message);
-                return;
             }
 #else
             catch (Exception)

+ 10 - 7
PicView/ChangeTitlebar/EditTitleBar.cs

@@ -1,8 +1,11 @@
-using PicView.FileHandling;
-using System.IO;
+using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Input;
+using System.Windows.Threading;
+using PicView.FileHandling;
+using PicView.Properties;
+using PicView.UILogic.Sizing;
 using static PicView.ChangeImage.Navigation;
 
 namespace PicView.UILogic
@@ -18,14 +21,14 @@ namespace PicView.UILogic
                 return;
             }
 
-            UILogic.Sizing.WindowSizing.Move(sender, e);
+            WindowSizing.Move(sender, e);
             Refocus();
             e.Handled = true; // Disable text clicking
         }
 
         internal static void Bar_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
         {
-            if (Pics == null || !Properties.Settings.Default.ShowInterface || Pics.Count == 0)
+            if (Pics == null || !Settings.Default.ShowInterface || Pics.Count == 0)
             {
                 e.Handled = true; // Disable text clicking
             }
@@ -33,7 +36,7 @@ namespace PicView.UILogic
 
         internal static void EditTitleBar_Text()
         {
-            if (Pics == null || !Properties.Settings.Default.ShowInterface || Pics.Count == 0)
+            if (Pics == null || !Settings.Default.ShowInterface || Pics.Count == 0)
             {
                 return;
             }
@@ -55,7 +58,7 @@ namespace PicView.UILogic
         /// <param name="e"></param>
         internal static void EditTitleBar_Text(object sender, KeyboardFocusChangedEventArgs e)
         {
-            if (Pics == null || !Properties.Settings.Default.ShowInterface || Pics.Count == 0)
+            if (Pics == null || !Settings.Default.ShowInterface || Pics.Count == 0)
             {
                 return;
             }
@@ -86,7 +89,7 @@ namespace PicView.UILogic
             {
                 Tooltip.ShowTooltipMessage(Application.Current.Resources["AnErrorOccuredMovingFile"]);
             }
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 Refocus(false);
             });

+ 6 - 4
PicView/ChangeTitlebar/SetTitle.cs

@@ -1,6 +1,8 @@
-using System.IO;
+using System;
+using System.IO;
 using System.Text;
 using System.Windows;
+using PicView.ChangeImage;
 using static PicView.ChangeImage.Navigation;
 using static PicView.FileHandling.FileFunctions;
 using static PicView.UILogic.TransformImage.ZoomLogic;
@@ -28,7 +30,7 @@ namespace PicView.UILogic
                 {
                     fileInfo = new FileInfo(Pics[index]);
                 }
-                catch (System.Exception)
+                catch (Exception)
                 {
                     return null;
                 }
@@ -36,7 +38,7 @@ namespace PicView.UILogic
 
             if (fileInfo.Exists == false)
             {
-                _ = ChangeImage.ErrorHandling.ReloadAsync();
+                _ = ErrorHandling.ReloadAsync();
                 return null;
             }
 
@@ -89,7 +91,7 @@ namespace PicView.UILogic
             var titleString = TitleString(width, height, index, fileInfo);
             if (titleString == null)
             {
-                _ = ChangeImage.ErrorHandling.ReloadAsync();
+                _ = ErrorHandling.ReloadAsync();
                 return;
             }
 

+ 26 - 26
PicView/ConfigureSettings/ConfigColors.cs

@@ -1,10 +1,10 @@
-using PicView.Animations;
-using PicView.Library.Resources;
-using PicView.UILogic;
-using System;
-using System.Diagnostics;
+using System;
 using System.Windows;
 using System.Windows.Media;
+using PicView.Animations;
+using PicView.Library.Resources;
+using PicView.Properties;
+using PicView.UILogic;
 
 namespace PicView.ConfigureSettings
 {
@@ -37,7 +37,7 @@ namespace PicView.ConfigureSettings
             Application.Current.Resources["ChosenColor"] = getColor;
             Application.Current.Resources["ChosenColorBrush"] = getColorBrush;
 
-            Properties.Settings.Default.Save();
+            Settings.Default.Save();
         }
 
         #endregion Update and set colors
@@ -77,22 +77,22 @@ namespace PicView.ConfigureSettings
                 return;
             }
 
-            Properties.Settings.Default.BgColorChoice++;
+            Settings.Default.BgColorChoice++;
 
-            if (Properties.Settings.Default.BgColorChoice > 3)
+            if (Settings.Default.BgColorChoice > 3)
             {
-                Properties.Settings.Default.BgColorChoice = 0;
+                Settings.Default.BgColorChoice = 0;
             }
 
             ConfigureWindows.GetMainWindow.MainImageBorder.Background = BackgroundColorBrush;
 
-            Properties.Settings.Default.Save();
+            Settings.Default.Save();
         }
 
-        internal static Brush BackgroundColorBrush => Properties.Settings.Default.BgColorChoice switch
+        internal static Brush BackgroundColorBrush => Settings.Default.BgColorChoice switch
         {
             0 => Brushes.Transparent,
-            1 => Properties.Settings.Default.DarkTheme ? Brushes.White : new SolidColorBrush(Color.FromRgb(25, 25, 25)),
+            1 => Settings.Default.DarkTheme ? Brushes.White : new SolidColorBrush(Color.FromRgb(25, 25, 25)),
             2 => DrawingBrushes.CheckerboardDrawingBrush(Colors.White),
             3 => DrawingBrushes.CheckerboardDrawingBrush(Color.FromRgb(76, 76, 76), Color.FromRgb(32, 32, 32), 56),
             _ => Brushes.Transparent,
@@ -109,7 +109,7 @@ namespace PicView.ConfigureSettings
                 Source = new Uri(@"/PicView;component/Themes/Styles/ColorThemes/Light.xaml", UriKind.Relative)
             };
 
-            Properties.Settings.Default.DarkTheme = false;
+            Settings.Default.DarkTheme = false;
         }
 
         internal static void ChangeToDarkTheme()
@@ -119,7 +119,7 @@ namespace PicView.ConfigureSettings
                 Source = new Uri(@"/PicView;component/Themes/Styles/ColorThemes/Dark.xaml", UriKind.Relative)
             };
 
-            Properties.Settings.Default.DarkTheme = true;
+            Settings.Default.DarkTheme = true;
         }
 
         #endregion Change Theme
@@ -128,73 +128,73 @@ namespace PicView.ConfigureSettings
 
         internal static void Blue(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 1;
+            Settings.Default.ColorTheme = 1;
             UpdateColor();
         }
 
         internal static void Pink(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 2;
+            Settings.Default.ColorTheme = 2;
             UpdateColor();
         }
 
         internal static void Orange(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 3;
+            Settings.Default.ColorTheme = 3;
             UpdateColor();
         }
 
         internal static void Green(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 4;
+            Settings.Default.ColorTheme = 4;
             UpdateColor();
         }
 
         internal static void Red(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 5;
+            Settings.Default.ColorTheme = 5;
             UpdateColor();
         }
 
         internal static void Teal(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 6;
+            Settings.Default.ColorTheme = 6;
             UpdateColor();
         }
 
         internal static void Aqua(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 7;
+            Settings.Default.ColorTheme = 7;
             UpdateColor();
         }
 
         internal static void Golden(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 8;
+            Settings.Default.ColorTheme = 8;
             UpdateColor();
         }
 
         internal static void Purple(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 9;
+            Settings.Default.ColorTheme = 9;
             UpdateColor();
         }
 
         internal static void Cyan(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 10;
+            Settings.Default.ColorTheme = 10;
             UpdateColor();
         }
 
         internal static void Magenta(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 11;
+            Settings.Default.ColorTheme = 11;
             UpdateColor();
         }
 
         internal static void Lime(object sender, RoutedEventArgs e)
         {
-            Properties.Settings.Default.ColorTheme = 12;
+            Settings.Default.ColorTheme = 12;
             UpdateColor();
         }
 

+ 34 - 31
PicView/ConfigureSettings/UpdateUIValues.cs

@@ -1,11 +1,14 @@
-using PicView.ChangeImage;
-using PicView.PicGallery;
-using PicView.UILogic;
-using PicView.UILogic.Sizing;
-using System.IO;
+using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.FileHandling;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
 using static PicView.UILogic.ConfigureWindows;
 using static PicView.UILogic.Tooltip;
 using static PicView.UILogic.TransformImage.Scroll;
@@ -20,30 +23,30 @@ namespace PicView.ConfigureSettings
         {
             if (changeOrder == false)
             {
-                Properties.Settings.Default.SortPreference = sorting;
+                Settings.Default.SortPreference = sorting;
             }
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
                 SetTitle.SetLoadingString();
             });
 
             FileInfo fileInfo;
-            var preloadValue = Preloader.Get(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex]);
+            var preloadValue = Preloader.Get(Navigation.Pics[Navigation.FolderIndex]);
             if (preloadValue is not null && preloadValue.FileInfo is not null)
             {
                 fileInfo = preloadValue.FileInfo;
             }
             else
             {
-                fileInfo = new FileInfo(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex]);
+                fileInfo = new FileInfo(Navigation.Pics[Navigation.FolderIndex]);
             }
 
             Preloader.Clear();
 
             bool sortGallery = false;
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
                 if (UC.GetPicGallery is not null && UC.GetPicGallery.Container.Children.Count > 0)
                 {
@@ -57,10 +60,10 @@ namespace PicView.ConfigureSettings
             }
             else
             {
-                await FileHandling.FileLists.RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
+                await FileLists.RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
             }
 
-            await ChangeImage.LoadPic.LoadPiFromFileAsync(fileInfo).ConfigureAwait(false);
+            await LoadPic.LoadPiFromFileAsync(fileInfo).ConfigureAwait(false);
         }
 
         internal static void SetScrolling()
@@ -73,7 +76,7 @@ namespace PicView.ConfigureSettings
             var scrollcm = settingscm.Items[1] as MenuItem;
             var scrollcmHeader = scrollcm.Header as CheckBox;
 
-            if (Properties.Settings.Default.ScrollEnabled)
+            if (Settings.Default.ScrollEnabled)
             {
                 _ = SetScrollBehaviour(false);
                 scrollcmHeader.IsChecked = false;
@@ -89,7 +92,7 @@ namespace PicView.ConfigureSettings
 
         internal static void SetScrolling(bool value)
         {
-            Properties.Settings.Default.ScrollEnabled = value;
+            Settings.Default.ScrollEnabled = value;
             SetScrolling();
         }
 
@@ -99,16 +102,16 @@ namespace PicView.ConfigureSettings
             var loopcm = settingscm.Items[0] as MenuItem;
             var loopcmHeader = loopcm.Header as CheckBox;
 
-            if (Properties.Settings.Default.Looping)
+            if (Settings.Default.Looping)
             {
-                Properties.Settings.Default.Looping = false;
+                Settings.Default.Looping = false;
                 loopcmHeader.IsChecked = false;
                 UC.GetQuickSettingsMenu.ToggleLooping.IsChecked = false;
                 ShowTooltipMessage(Application.Current.Resources["LoopingDisabled"]);
             }
             else
             {
-                Properties.Settings.Default.Looping = true;
+                Settings.Default.Looping = true;
                 loopcmHeader.IsChecked = true;
                 UC.GetQuickSettingsMenu.ToggleLooping.IsChecked = true;
                 ShowTooltipMessage(Application.Current.Resources["LoopingEnabled"]);
@@ -117,7 +120,7 @@ namespace PicView.ConfigureSettings
 
         internal static void SetTopMost()
         {
-            if (Properties.Settings.Default.Fullscreen)
+            if (Settings.Default.Fullscreen)
             {
                 return;
             }
@@ -126,26 +129,26 @@ namespace PicView.ConfigureSettings
             var TopmostMenu = (MenuItem)settingscm.Items[4];
             var TopmostHeader = (CheckBox)TopmostMenu.Header;
 
-            if (Properties.Settings.Default.TopMost)
+            if (Settings.Default.TopMost)
             {
-                Properties.Settings.Default.TopMost = false;
-                ConfigureWindows.GetMainWindow.Topmost = false;
+                Settings.Default.TopMost = false;
+                GetMainWindow.Topmost = false;
                 TopmostHeader.IsChecked = false;
 
-                if (ConfigureWindows.GetSettingsWindow is not null)
+                if (GetSettingsWindow is not null)
                 {
-                    ConfigureWindows.GetSettingsWindow.TopmostRadio.IsChecked = false;
+                    GetSettingsWindow.TopmostRadio.IsChecked = false;
                 }
             }
             else
             {
-                Properties.Settings.Default.TopMost = true;
-                ConfigureWindows.GetMainWindow.Topmost = true;
+                Settings.Default.TopMost = true;
+                GetMainWindow.Topmost = true;
                 TopmostHeader.IsChecked = true;
 
-                if (ConfigureWindows.GetSettingsWindow is not null)
+                if (GetSettingsWindow is not null)
                 {
-                    ConfigureWindows.GetSettingsWindow.TopmostRadio.IsChecked = true;
+                    GetSettingsWindow.TopmostRadio.IsChecked = true;
                 }
             }
         }
@@ -153,19 +156,19 @@ namespace PicView.ConfigureSettings
         internal static async Task SetAutoFitAsync(object sender, RoutedEventArgs e)
         {
             if (GalleryFunctions.IsHorizontalFullscreenOpen || GalleryFunctions.IsVerticalFullscreenOpen) { return; }
-            await SetScalingBehaviourAsync(Properties.Settings.Default.AutoFitWindow = !Properties.Settings.Default.AutoFitWindow, Properties.Settings.Default.FillImage).ConfigureAwait(false);
+            await SetScalingBehaviourAsync(Settings.Default.AutoFitWindow = !Settings.Default.AutoFitWindow, Settings.Default.FillImage).ConfigureAwait(false);
         }
 
         internal static async Task SetAutoFillAsync(object sender, RoutedEventArgs e)
         {
             if (GalleryFunctions.IsHorizontalFullscreenOpen || GalleryFunctions.IsVerticalFullscreenOpen) { return; }
-            await SetScalingBehaviourAsync(Properties.Settings.Default.AutoFitWindow, !Properties.Settings.Default.FillImage).ConfigureAwait(false);
+            await SetScalingBehaviourAsync(Settings.Default.AutoFitWindow, !Settings.Default.FillImage).ConfigureAwait(false);
         }
 
         internal static async Task SetScalingBehaviourAsync(bool autoFit, bool fill)
         {
-            Properties.Settings.Default.FillImage = fill;
-            Properties.Settings.Default.AutoFitWindow = autoFit;
+            Settings.Default.FillImage = fill;
+            Settings.Default.AutoFitWindow = autoFit;
 
             if (autoFit)
             {

+ 10 - 8
PicView/Editing/Color_Picking.cs

@@ -1,13 +1,15 @@
-using PicView.UILogic;
-using PicView.UILogic.Loading;
-using PicView.UILogic.TransformImage;
-using System.Globalization;
+using System.Globalization;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
+using System.Windows.Threading;
+using PicView.UILogic;
+using PicView.UILogic.Loading;
+using PicView.UILogic.TransformImage;
 using static PicView.SystemIntegration.NativeMethods;
+using Color = System.Drawing.Color;
 
 namespace PicView.Editing
 {
@@ -40,7 +42,7 @@ namespace PicView.Editing
             UC.GetColorPicker.RectangleColorPresenter.Fill =
             UC.GetColorPicker.MainColorPresenter.Fill = new SolidColorBrush
             {
-                Color = Color.FromRgb(
+                Color = System.Windows.Media.Color.FromRgb(
                         c.R, c.G, c.B
                     )
             };
@@ -69,7 +71,7 @@ namespace PicView.Editing
                     Clipboard.SetText(x);
                     Tooltip.ShowTooltipMessage(x + " " + Application.Current.Resources["AddedToClipboard"]);
                 }
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                 {
                     ConfigureWindows.GetMainWindow.topLayer.Children.Remove(UC.GetColorPicker);
                     ConfigureWindows.GetMainWindow.Focus();
@@ -79,7 +81,7 @@ namespace PicView.Editing
             IsRunning = false;
         }
 
-        internal static string HexConverter(System.Drawing.Color c)
+        internal static string HexConverter(Color c)
         {
             return "#" +
                 c.R.ToString("X2", CultureInfo.InvariantCulture) +
@@ -87,7 +89,7 @@ namespace PicView.Editing
                 c.B.ToString("X2", CultureInfo.InvariantCulture);
         }
 
-        internal static string RGBConverter(System.Drawing.Color c)
+        internal static string RGBConverter(Color c)
         {
             return "RGB(" +
                 c.R.ToString("X2", CultureInfo.InvariantCulture) +

+ 2 - 2
PicView/Editing/Crop/CropContextMenu.cs

@@ -1,8 +1,8 @@
-using PicView.UILogic;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Shapes;
+using PicView.UILogic;
 
 namespace PicView.Editing.Crop
 {

+ 10 - 10
PicView/Editing/Crop/CropFunctions.cs

@@ -1,15 +1,15 @@
-using Microsoft.Win32;
-using PicView.ChangeImage;
-using PicView.FileHandling;
-using PicView.ImageHandling;
-using PicView.UILogic;
-using PicView.UILogic.Loading;
-using System;
+using System;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using Microsoft.Win32;
+using PicView.ChangeImage;
+using PicView.FileHandling;
+using PicView.ImageHandling;
+using PicView.UILogic;
+using PicView.UILogic.Loading;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.Sizing.ScaleImage;
 using static PicView.UILogic.TransformImage.Rotation;
@@ -46,8 +46,8 @@ namespace PicView.Editing.Crop
             var sameFile = await SaveCrop().ConfigureAwait(false);
             if (sameFile)
             {
-                Preloader.Remove(Navigation.FolderIndex);
-                await LoadPic.LoadPiFromFileAsync(Navigation.Pics[Navigation.FolderIndex]).ConfigureAwait(false);
+                Preloader.Remove(FolderIndex);
+                await LoadPic.LoadPiFromFileAsync(Pics[FolderIndex]).ConfigureAwait(false);
             }
 
             await ConfigureWindows.GetMainWindow.Dispatcher.InvokeAsync(() =>
@@ -93,7 +93,7 @@ namespace PicView.Editing.Crop
         {
             string filename;
             string? directory;
-            if (ChangeImage.ErrorHandling.CheckOutOfRange() == false)
+            if (ErrorHandling.CheckOutOfRange() == false)
             {
                 filename = Path.GetRandomFileName();
                 directory = null;

+ 5 - 4
PicView/Editing/Crop/CropService.cs

@@ -1,12 +1,13 @@
-using PicView.Editing.Crop.State;
-using PicView.Editing.Crop.Tools;
-using System.Diagnostics;
+using System.Diagnostics;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Documents;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Shapes;
+using PicView.Editing.Crop.State;
+using PicView.Editing.Crop.Tools;
+using PicView.UILogic;
 
 namespace PicView.Editing.Crop
 {
@@ -49,7 +50,7 @@ namespace PicView.Editing.Crop
             }
 
             // Make sure menus are hidden when cropping
-            UILogic.UC.Close_UserControls();
+            UC.Close_UserControls();
 
             // Show context menu
             _ = new CropContextMenu();

+ 2 - 2
PicView/Editing/Crop/State/CreateState.cs

@@ -1,7 +1,7 @@
-using PicView.Editing.Crop.Tools;
-using System;
+using System;
 using System.Windows;
 using System.Windows.Controls;
+using PicView.Editing.Crop.Tools;
 
 namespace PicView.Editing.Crop.State
 {

+ 2 - 2
PicView/Editing/Crop/State/DragState.cs

@@ -1,7 +1,7 @@
-using PicView.Editing.Crop.Tools;
-using System;
+using System;
 using System.Windows;
 using System.Windows.Controls;
+using PicView.Editing.Crop.Tools;
 
 namespace PicView.Editing.Crop.State
 {

+ 3 - 2
PicView/Editing/Crop/Tools/TextTool.cs

@@ -1,6 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
+using PicView.ConfigureSettings;
 
 namespace PicView.Editing.Crop.Tools
 {
@@ -20,7 +21,7 @@ namespace PicView.Editing.Crop.Tools
 
             Border = new Border
             {
-                Background = new SolidColorBrush(ConfigureSettings.ConfigColors.BackgroundBorderColor),
+                Background = new SolidColorBrush(ConfigColors.BackgroundBorderColor),
                 Padding = new Thickness(9),
                 BorderBrush = (SolidColorBrush)Application.Current.Resources["BorderBrush"],
                 BorderThickness = new Thickness(1),
@@ -31,7 +32,7 @@ namespace PicView.Editing.Crop.Tools
             {
                 FontFamily = new FontFamily("/PicView;component/Themes/Resources/fonts/#Tex Gyre Heros"),
                 FontSize = 16,
-                Foreground = new SolidColorBrush(ConfigureSettings.ConfigColors.MainColor),
+                Foreground = new SolidColorBrush(ConfigColors.MainColor),
             };
             Border.Child = TextBlock;
         }

+ 56 - 57
PicView/Editing/ShaderEffects/Hlsl.cs

@@ -13,17 +13,16 @@ using System.Windows;
 using System.Windows.Media;
 using System.Windows.Media.Effects;
 
-
 namespace PicView.Editing.HlslEffects
 {
 
     /// <summary>An effect that inverts all colors.</summary>
     public class InvertColorEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(InvertColorEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(InvertColorEffect), 0);
         public InvertColorEffect()
         {
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/InvertColorEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -44,12 +43,12 @@ namespace PicView.Editing.HlslEffects
     /// <summary>A transition effect </summary>
     public class Transition_RippleEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(Transition_RippleEffect), 0);
-        public static readonly DependencyProperty Texture2Property = ShaderEffect.RegisterPixelShaderSamplerProperty("Texture2", typeof(Transition_RippleEffect), 1);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(Transition_RippleEffect), 0);
+        public static readonly DependencyProperty Texture2Property = RegisterPixelShaderSamplerProperty("Texture2", typeof(Transition_RippleEffect), 1);
         public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register("Progress", typeof(double), typeof(Transition_RippleEffect), new UIPropertyMetadata(((double)(30D)), PixelShaderConstantCallback(0)));
         public Transition_RippleEffect()
         {
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/Transition_RippleEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -95,7 +94,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that blends between partial desaturation and a two-color ramp.</summary>
     public class ColorToneEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(ColorToneEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(ColorToneEffect), 0);
         public static readonly DependencyProperty DesaturationProperty = DependencyProperty.Register("Desaturation", typeof(double), typeof(ColorToneEffect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty TonedProperty = DependencyProperty.Register("Toned", typeof(double), typeof(ColorToneEffect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty LightColorProperty = DependencyProperty.Register("LightColor", typeof(Color), typeof(ColorToneEffect), new UIPropertyMetadata(Color.FromArgb(255, 255, 255, 0), PixelShaderConstantCallback(2)));
@@ -107,7 +106,7 @@ namespace PicView.Editing.HlslEffects
             Desaturation = intensity / 100;
             Toned = intensity / 200;
 
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/ColorToneEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -181,11 +180,11 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that turns the input into shades of a single color.</summary>
     public class MonochromeEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(MonochromeEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(MonochromeEffect), 0);
         public static readonly DependencyProperty FilterColorProperty = DependencyProperty.Register("FilterColor", typeof(Color), typeof(MonochromeEffect), new UIPropertyMetadata(Color.FromArgb(255, 255, 255, 0), PixelShaderConstantCallback(0)));
         public MonochromeEffect()
         {
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/MonochromeEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -219,7 +218,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that superimposes rippling waves upon the input.</summary>
     public class RippleEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(RippleEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(RippleEffect), 0);
         public static readonly DependencyProperty CenterProperty = DependencyProperty.Register("Center", typeof(Point), typeof(RippleEffect), new UIPropertyMetadata(new Point(0.5D, 0.5D), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty AmplitudeProperty = DependencyProperty.Register("Amplitude", typeof(double), typeof(RippleEffect), new UIPropertyMetadata(((double)(0.1D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty FrequencyProperty = DependencyProperty.Register("Frequency", typeof(double), typeof(RippleEffect), new UIPropertyMetadata(((double)(70D)), PixelShaderConstantCallback(2)));
@@ -228,7 +227,7 @@ namespace PicView.Editing.HlslEffects
         public RippleEffect(double intensity)
         {
             Amplitude = intensity / 100;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/RippleEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -314,14 +313,14 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that swirls the input in a spiral.</summary>
     public class SwirlEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(SwirlEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(SwirlEffect), 0);
         public static readonly DependencyProperty CenterProperty = DependencyProperty.Register("Center", typeof(Point), typeof(SwirlEffect), new UIPropertyMetadata(new Point(0.5D, 0.5D), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty SpiralStrengthProperty = DependencyProperty.Register("SpiralStrength", typeof(double), typeof(SwirlEffect), new UIPropertyMetadata(((double)(10D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty AspectRatioProperty = DependencyProperty.Register("AspectRatio", typeof(double), typeof(SwirlEffect), new UIPropertyMetadata(((double)(1.5D)), PixelShaderConstantCallback(2)));
         public SwirlEffect(double intensity)
         {
             SpiralStrength = intensity / 250;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/SwirlEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -381,7 +380,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that intensifies bright regions.</summary>
     public class BloomEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(BloomEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(BloomEffect), 0);
         public static readonly DependencyProperty BloomIntensityProperty = DependencyProperty.Register("BloomIntensity", typeof(double), typeof(BloomEffect), new UIPropertyMetadata(((double)(1D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty BaseIntensityProperty = DependencyProperty.Register("BaseIntensity", typeof(double), typeof(BloomEffect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty BloomSaturationProperty = DependencyProperty.Register("BloomSaturation", typeof(double), typeof(BloomEffect), new UIPropertyMetadata(((double)(1D)), PixelShaderConstantCallback(2)));
@@ -389,7 +388,7 @@ namespace PicView.Editing.HlslEffects
         public BloomEffect(double intensity)
         {
             BaseIntensity = intensity / 50;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/BloomEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -462,7 +461,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that applies defogging, exposure, gamma, vignette, and blue shift corrections.</summary>
     public class ToneMappingEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(ToneMappingEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(ToneMappingEffect), 0);
         public static readonly DependencyProperty DefogProperty = DependencyProperty.Register("Defog", typeof(double), typeof(ToneMappingEffect), new UIPropertyMetadata(((double)(0.01D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty FogColorProperty = DependencyProperty.Register("FogColor", typeof(Color), typeof(ToneMappingEffect), new UIPropertyMetadata(Color.FromArgb(255, 255, 255, 255), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty ExposureProperty = DependencyProperty.Register("Exposure", typeof(double), typeof(ToneMappingEffect), new UIPropertyMetadata(((double)(0.2D)), PixelShaderConstantCallback(2)));
@@ -474,7 +473,7 @@ namespace PicView.Editing.HlslEffects
         public ToneMappingEffect(double intensity)
         {
             Exposure = intensity / 110;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/ToneMappingEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -599,7 +598,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that intensifies dark regions.</summary>
     public class GloomEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(GloomEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GloomEffect), 0);
         public static readonly DependencyProperty GloomIntensityProperty = DependencyProperty.Register("GloomIntensity", typeof(double), typeof(GloomEffect), new UIPropertyMetadata(((double)(1D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty BaseIntensityProperty = DependencyProperty.Register("BaseIntensity", typeof(double), typeof(GloomEffect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty GloomSaturationProperty = DependencyProperty.Register("GloomSaturation", typeof(double), typeof(GloomEffect), new UIPropertyMetadata(((double)(0.2D)), PixelShaderConstantCallback(2)));
@@ -607,7 +606,7 @@ namespace PicView.Editing.HlslEffects
         public GloomEffect(double intensity)
         {
             BaseIntensity = intensity / 70;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/GloomEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -679,7 +678,7 @@ namespace PicView.Editing.HlslEffects
     }
     public class TelescopicBlurPS3Effect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(TelescopicBlurPS3Effect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(TelescopicBlurPS3Effect), 0);
         public static readonly DependencyProperty CenterXProperty = DependencyProperty.Register("CenterX", typeof(double), typeof(TelescopicBlurPS3Effect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty CenterYProperty = DependencyProperty.Register("CenterY", typeof(double), typeof(TelescopicBlurPS3Effect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty ZoomBlurAmountProperty = DependencyProperty.Register("ZoomBlurAmount", typeof(double), typeof(TelescopicBlurPS3Effect), new UIPropertyMetadata(((double)(2.5D)), PixelShaderConstantCallback(2)));
@@ -687,7 +686,7 @@ namespace PicView.Editing.HlslEffects
         public TelescopicBlurPS3Effect(double intensity)
         {
             ZoomBlurAmount = intensity / 18;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/TelescopicBlurPS3Effect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -760,12 +759,12 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that blurs the input using Poisson disk sampling.</summary>
     public class GrowablePoissonDiskEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(GrowablePoissonDiskEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GrowablePoissonDiskEffect), 0);
         public static readonly DependencyProperty DiskRadiusProperty = DependencyProperty.Register("DiskRadius", typeof(double), typeof(GrowablePoissonDiskEffect), new UIPropertyMetadata(((double)(5D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty InputSizeProperty = DependencyProperty.Register("InputSize", typeof(Size), typeof(GrowablePoissonDiskEffect), new UIPropertyMetadata(new Size(600D, 400D), PixelShaderConstantCallback(1)));
         public GrowablePoissonDiskEffect()
         {
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/GrowablePoissonDiskEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -812,14 +811,14 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that blurs in a single direction.</summary>
     public class DirectionalBlurEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(DirectionalBlurEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(DirectionalBlurEffect), 0);
         public static readonly DependencyProperty AngleProperty = DependencyProperty.Register("Angle", typeof(double), typeof(DirectionalBlurEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty BlurAmountProperty = DependencyProperty.Register("BlurAmount", typeof(double), typeof(DirectionalBlurEffect), new UIPropertyMetadata(((double)(0.003D)), PixelShaderConstantCallback(1)));
         public DirectionalBlurEffect(double intensity)
         {
             intensity = intensity == 0 ? 1 : intensity;
             BlurAmount = intensity / 10000;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/DirectionalBlurEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -866,7 +865,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that swirls the input in alternating clockwise and counterclockwise bands.</summary>
     public class BandedSwirlEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(BandedSwirlEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(BandedSwirlEffect), 0);
         public static readonly DependencyProperty CenterProperty = DependencyProperty.Register("Center", typeof(Point), typeof(BandedSwirlEffect), new UIPropertyMetadata(new Point(0.5D, 0.5D), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty BandsProperty = DependencyProperty.Register("Bands", typeof(double), typeof(BandedSwirlEffect), new UIPropertyMetadata(((double)(10D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty StrengthProperty = DependencyProperty.Register("Strength", typeof(double), typeof(BandedSwirlEffect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(2)));
@@ -875,7 +874,7 @@ namespace PicView.Editing.HlslEffects
         {
             intensity = intensity == 0 ? 1 : intensity;
             Strength = intensity / 100;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/BandedSwirlEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -948,7 +947,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that creates bands of bright regions.</summary>
     public class BandsEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(BandsEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(BandsEffect), 0);
         public static readonly DependencyProperty BandDensityProperty = DependencyProperty.Register("BandDensity", typeof(double), typeof(BandsEffect), new UIPropertyMetadata(((double)(65D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty BandIntensityProperty = DependencyProperty.Register("BandIntensity", typeof(double), typeof(BandsEffect), new UIPropertyMetadata(((double)(0.056D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty IsRightSideBandProperty = DependencyProperty.Register("IsRightSideBand", typeof(double), typeof(BandsEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(2)));
@@ -956,7 +955,7 @@ namespace PicView.Editing.HlslEffects
         {
             intensity = intensity == 0 ? 1 : intensity;
             BandIntensity = intensity / 500;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/BandsEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1016,14 +1015,14 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that embosses the input.</summary>
     public class EmbossedEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(EmbossedEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(EmbossedEffect), 0);
         public static readonly DependencyProperty EmbossedAmountProperty = DependencyProperty.Register("EmbossedAmount", typeof(double), typeof(EmbossedEffect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty WidthProperty = DependencyProperty.Register("Width", typeof(double), typeof(EmbossedEffect), new UIPropertyMetadata(((double)(0.003D)), PixelShaderConstantCallback(1)));
         public EmbossedEffect(double intensity)
         {
             intensity = intensity == 0 ? 1 : intensity;
             EmbossedAmount = intensity / 100;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/EmbossedEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1070,7 +1069,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect mimics the look of glass tiles.</summary>
     public class GlassTilesEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(GlassTilesEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GlassTilesEffect), 0);
         public static readonly DependencyProperty TilesProperty = DependencyProperty.Register("Tiles", typeof(double), typeof(GlassTilesEffect), new UIPropertyMetadata(((double)(5D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty BevelWidthProperty = DependencyProperty.Register("BevelWidth", typeof(double), typeof(GlassTilesEffect), new UIPropertyMetadata(((double)(1D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty OffsetProperty = DependencyProperty.Register("Offset", typeof(double), typeof(GlassTilesEffect), new UIPropertyMetadata(((double)(1D)), PixelShaderConstantCallback(3)));
@@ -1079,7 +1078,7 @@ namespace PicView.Editing.HlslEffects
         {
             intensity = intensity == 0 ? 1 : intensity;
             Tiles = intensity / 10;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/GlassTilesEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1149,7 +1148,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that magnifies a circular region with a smooth boundary.</summary>
     public class MagnifySmoothEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(MagnifySmoothEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(MagnifySmoothEffect), 0);
         public static readonly DependencyProperty CenterPointProperty = DependencyProperty.Register("CenterPoint", typeof(Point), typeof(MagnifySmoothEffect), new UIPropertyMetadata(new Point(0.5D, 0.5D), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty InnerRadiusProperty = DependencyProperty.Register("InnerRadius", typeof(double), typeof(MagnifySmoothEffect), new UIPropertyMetadata(((double)(0.2D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty OuterRadiusProperty = DependencyProperty.Register("OuterRadius", typeof(double), typeof(MagnifySmoothEffect), new UIPropertyMetadata(((double)(0.4D)), PixelShaderConstantCallback(2)));
@@ -1161,7 +1160,7 @@ namespace PicView.Editing.HlslEffects
             InnerRadius = intensity / 800;
             OuterRadius = intensity / 300;
             MagnificationAmount = intensity / 150;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/MagnifySmoothEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1246,13 +1245,13 @@ namespace PicView.Editing.HlslEffects
     }
     public class PaperFoldEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(PaperFoldEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(PaperFoldEffect), 0);
         public static readonly DependencyProperty FoldAmountProperty = DependencyProperty.Register("FoldAmount", typeof(double), typeof(PaperFoldEffect), new UIPropertyMetadata(((double)(0.2D)), PixelShaderConstantCallback(0)));
         public PaperFoldEffect(double intensity)
         {
             intensity = intensity == 0 ? 1 : intensity;
             FoldAmount = intensity / 450;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/PaperFoldEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1286,14 +1285,14 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that pivots the output around a center point.</summary>
     public class PivotEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(PivotEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(PivotEffect), 0);
         public static readonly DependencyProperty PivotAmountProperty = DependencyProperty.Register("PivotAmount", typeof(double), typeof(PivotEffect), new UIPropertyMetadata(((double)(0.2D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty EdgeProperty = DependencyProperty.Register("Edge", typeof(double), typeof(PivotEffect), new UIPropertyMetadata(((double)(0.5D)), PixelShaderConstantCallback(1)));
         public PivotEffect(double intensity)
         {
             intensity = intensity == 0 ? 1 : intensity;
             PivotAmount = intensity / 500;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/PivotEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1339,7 +1338,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>Applies water defraction effect.</summary>
     public class UnderwaterEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(UnderwaterEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(UnderwaterEffect), 0);
         public static readonly DependencyProperty TimerProperty = DependencyProperty.Register("Timer", typeof(double), typeof(UnderwaterEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty RefractonProperty = DependencyProperty.Register("Refracton", typeof(double), typeof(UnderwaterEffect), new UIPropertyMetadata(((double)(50D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty VerticalTroughWidthProperty = DependencyProperty.Register("VerticalTroughWidth", typeof(double), typeof(UnderwaterEffect), new UIPropertyMetadata(((double)(23D)), PixelShaderConstantCallback(2)));
@@ -1349,7 +1348,7 @@ namespace PicView.Editing.HlslEffects
             intensity = intensity == 0 ? 1 : intensity;
             Wobble2 = intensity / 7;
             Refracton = intensity / 3;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/UnderwaterEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1421,13 +1420,13 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that applies a wave pattern to the inputSampler.</summary>
     public class WaveWarperEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(WaveWarperEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(WaveWarperEffect), 0);
         public static readonly DependencyProperty TimeProperty = DependencyProperty.Register("Time", typeof(double), typeof(WaveWarperEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty WaveSizeProperty = DependencyProperty.Register("WaveSize", typeof(double), typeof(WaveWarperEffect), new UIPropertyMetadata(((double)(64D)), PixelShaderConstantCallback(1)));
         public WaveWarperEffect(double intensity)
         {
             WaveSize = intensity;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/WaveWarperEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1473,7 +1472,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that turns the inputSampler into shades of a single color.</summary>
     public class FrostyOutlineEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(FrostyOutlineEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(FrostyOutlineEffect), 0);
         public static readonly DependencyProperty WidthProperty = DependencyProperty.Register("Width", typeof(double), typeof(FrostyOutlineEffect), new UIPropertyMetadata(((double)(500D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty HeightProperty = DependencyProperty.Register("Height", typeof(double), typeof(FrostyOutlineEffect), new UIPropertyMetadata(((double)(300D)), PixelShaderConstantCallback(1)));
         public FrostyOutlineEffect(double intensity)
@@ -1481,7 +1480,7 @@ namespace PicView.Editing.HlslEffects
             intensity = intensity == 0 ? 1 : intensity;
             Width = intensity * 6;
             Height = intensity * 3;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/FrostyOutlineEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1528,17 +1527,17 @@ namespace PicView.Editing.HlslEffects
     /// <summary>Pixel shader which produces random scratches, noise and other FX like an old projector</summary>
     public class OldMovieEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(OldMovieEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(OldMovieEffect), 0);
         public static readonly DependencyProperty ScratchAmountProperty = DependencyProperty.Register("ScratchAmount", typeof(double), typeof(OldMovieEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty NoiseAmountProperty = DependencyProperty.Register("NoiseAmount", typeof(double), typeof(OldMovieEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(1)));
         public static readonly DependencyProperty RandomCoord1Property = DependencyProperty.Register("RandomCoord1", typeof(Point), typeof(OldMovieEffect), new UIPropertyMetadata(new Point(0D, 0D), PixelShaderConstantCallback(2)));
         public static readonly DependencyProperty RandomCoord2Property = DependencyProperty.Register("RandomCoord2", typeof(Point), typeof(OldMovieEffect), new UIPropertyMetadata(new Point(0D, 0D), PixelShaderConstantCallback(3)));
         public static readonly DependencyProperty FrameProperty = DependencyProperty.Register("Frame", typeof(double), typeof(OldMovieEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(4)));
-        public static readonly DependencyProperty NoiseSamplerProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("NoiseSampler", typeof(OldMovieEffect), 1);
+        public static readonly DependencyProperty NoiseSamplerProperty = RegisterPixelShaderSamplerProperty("NoiseSampler", typeof(OldMovieEffect), 1);
         public OldMovieEffect(double intensity)
         {
             ScratchAmount = intensity / 100;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/OldMovieEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1634,7 +1633,7 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An effect that turns the input into blocky pixels.</summary>
     public class PixelateEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(PixelateEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(PixelateEffect), 0);
         public static readonly DependencyProperty PixelCountsProperty = DependencyProperty.Register("PixelCounts", typeof(Size), typeof(PixelateEffect), new UIPropertyMetadata(new Size(50D, 40D), PixelShaderConstantCallback(0)));
         public static readonly DependencyProperty BrickOffsetProperty = DependencyProperty.Register("BrickOffset", typeof(double), typeof(PixelateEffect), new UIPropertyMetadata(((double)(0D)), PixelShaderConstantCallback(1)));
 
@@ -1651,7 +1650,7 @@ namespace PicView.Editing.HlslEffects
                 default: break;
             }
 
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/PixelateEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1699,13 +1698,13 @@ namespace PicView.Editing.HlslEffects
     /// <summary>An paper sketch effect.</summary>
     public class SketchGraniteEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(SketchGraniteEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(SketchGraniteEffect), 0);
         public static readonly DependencyProperty BrushSizeProperty = DependencyProperty.Register("BrushSize", typeof(double), typeof(SketchGraniteEffect), new UIPropertyMetadata(((double)(0.003D)), PixelShaderConstantCallback(0)));
         public SketchGraniteEffect(double intensity)
         {
             intensity = intensity == 0 ? 1 : intensity;
             BrushSize = intensity / 30000;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/SketchGraniteEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1739,13 +1738,13 @@ namespace PicView.Editing.HlslEffects
     /// <summary>A pencil stroke effect.</summary>
     public class SketchPencilStrokeEffect : ShaderEffect
     {
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(SketchPencilStrokeEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(SketchPencilStrokeEffect), 0);
         public static readonly DependencyProperty BrushSizeProperty = DependencyProperty.Register("BrushSize", typeof(double), typeof(SketchPencilStrokeEffect), new UIPropertyMetadata(((double)(0.005D)), PixelShaderConstantCallback(0)));
         public SketchPencilStrokeEffect(double intensity)
         {
             intensity = intensity == 0 ? 1 : intensity;
             BrushSize = intensity / 5000;
-            PixelShader pixelShader = new PixelShader(); string path = System.AppDomain.CurrentDomain.BaseDirectory;
+            PixelShader pixelShader = new PixelShader(); string path = AppDomain.CurrentDomain.BaseDirectory;
             pixelShader.UriSource = new Uri(path + "Editing/ShaderEffects/PsEffects/SketchPencilStrokeEffect.ps", UriKind.RelativeOrAbsolute);
             this.PixelShader = pixelShader;
 
@@ -1779,7 +1778,7 @@ namespace PicView.Editing.HlslEffects
 
     public class GrayscaleEffect : ShaderEffect
     {
-        private static PixelShader _pixelShader = new PixelShader() { UriSource = new Uri(System.AppDomain.CurrentDomain.BaseDirectory + "Editing/ShaderEffects/PsEffects/GrayscaleEffect.ps") };
+        private static PixelShader _pixelShader = new PixelShader() { UriSource = new Uri(AppDomain.CurrentDomain.BaseDirectory + "Editing/ShaderEffects/PsEffects/GrayscaleEffect.ps") };
 
         public GrayscaleEffect()
         {
@@ -1789,7 +1788,7 @@ namespace PicView.Editing.HlslEffects
             UpdateShaderValue(DesaturationFactorProperty);
         }
 
-        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(GrayscaleEffect), 0);
+        public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GrayscaleEffect), 0);
         public Brush Input
         {
             get { return (Brush)GetValue(InputProperty); }

+ 12 - 10
PicView/FileHandling/ArchiveExtraction.cs

@@ -1,8 +1,10 @@
-using PicView.ChangeImage;
-using PicView.SystemIntegration;
-using System;
+using System;
 using System.Diagnostics;
 using System.IO;
+using PicView.ChangeImage;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.SystemIntegration;
 using static PicView.ChangeImage.Navigation;
 using static PicView.FileHandling.FileLists;
 
@@ -43,8 +45,8 @@ namespace PicView.FileHandling
             const string sevenzip = "7z.exe";
             const string sevenzipPath = "\\7-Zip\\7z.exe";
 
-            var appNames = new string[] { winRar, sevenzip };
-            var appPathNames = new string[] { winRarPath, sevenzipPath };
+            var appNames = new[] { winRar, sevenzip };
+            var appPathNames = new[] { winRarPath, sevenzipPath };
 
             string? getextractPath = GetExtractApp(appPathNames, appNames);
 
@@ -102,7 +104,7 @@ namespace PicView.FileHandling
             // Create backup
             if (ErrorHandling.CheckOutOfRange() == false)
             {
-                Navigation.BackupPath = Navigation.Pics[Navigation.FolderIndex];
+                BackupPath = Pics[FolderIndex];
             }
 
             var arguments = winrar ?
@@ -146,7 +148,7 @@ namespace PicView.FileHandling
             {
                 if (SetDirectory())
                 {
-                    if (Navigation.FolderIndex > 0)
+                    if (FolderIndex > 0)
                     {
                         await LoadPic.LoadPiFromFileAsync(Pics[0]).ConfigureAwait(false);
                     }
@@ -154,14 +156,14 @@ namespace PicView.FileHandling
                     // Add zipped files as recent file
                     History.Add(TempZipFile);
 
-                    if (Properties.Settings.Default.FullscreenGalleryHorizontal)
+                    if (Settings.Default.FullscreenGalleryHorizontal)
                     {
-                        await PicGallery.GalleryLoad.Load().ConfigureAwait(false);
+                        await GalleryLoad.Load().ConfigureAwait(false);
                     }
                 }
                 else
                 {
-                    await ChangeImage.ErrorHandling.ReloadAsync(true).ConfigureAwait(false);
+                    await ErrorHandling.ReloadAsync(true).ConfigureAwait(false);
                 }
             };
 

+ 10 - 8
PicView/FileHandling/Copy-paste.cs

@@ -1,11 +1,13 @@
-using PicView.ChangeImage;
-using PicView.ImageHandling;
-using PicView.UILogic;
-using System;
+using System;
+using System.Collections.Specialized;
 using System.IO;
 using System.Linq;
 using System.Windows;
 using System.Windows.Media.Imaging;
+using PicView.ChangeImage;
+using PicView.ImageHandling;
+using PicView.ProcessHandling;
+using PicView.UILogic;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.Tooltip;
 
@@ -54,7 +56,7 @@ namespace PicView.FileHandling
         /// </summary>
         internal static void Copyfile(string path)
         {
-            var paths = new System.Collections.Specialized.StringCollection { path };
+            var paths = new StringCollection { path };
             Clipboard.SetFileDropList(paths);
             ShowTooltipMessage(Application.Current.Resources["FileCopy"]);
         }
@@ -103,7 +105,7 @@ namespace PicView.FileHandling
                     {
                         for (int i = 1; i < files.Length; i++)
                         {
-                            ProcessHandling.ProcessLogic.StartProcessWithFileArgument(files[i]);
+                            ProcessLogic.StartProcessWithFileArgument(files[i]);
                         }
                     }
                     return;
@@ -148,12 +150,12 @@ namespace PicView.FileHandling
                 return;
             }
 
-            var x = new System.Collections.Specialized.StringCollection
+            var x = new StringCollection
             {
                 Pics[FolderIndex]
             };
 
-            byte[] moveEffect = new byte[] { 2, 0, 0, 0 };
+            byte[] moveEffect = { 2, 0, 0, 0 };
             using (var dropEffect = new MemoryStream())
             {
                 dropEffect.Write(moveEffect, 0, moveEffect.Length);

+ 8 - 7
PicView/FileHandling/DeleteFiles.cs

@@ -1,11 +1,12 @@
-using Microsoft.VisualBasic.FileIO;
-using PicView.ChangeImage;
-using PicView.UILogic;
-using System;
+using System;
 using System.Diagnostics;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
+using System.Windows.Threading;
+using Microsoft.VisualBasic.FileIO;
+using PicView.ChangeImage;
+using PicView.UILogic;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.Tooltip;
 
@@ -97,12 +98,12 @@ namespace PicView.FileHandling
             // Sync with preloader
             Preloader.Remove(FolderIndex);
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 // Sync with gallery
-                if (UC.GetPicGallery is not null && UC.GetPicGallery.Container.Children.Count > ChangeImage.Navigation.FolderIndex)
+                if (UC.GetPicGallery is not null && UC.GetPicGallery.Container.Children.Count > FolderIndex)
                 {
-                    UC.GetPicGallery.Container.Children.RemoveAt(ChangeImage.Navigation.FolderIndex);
+                    UC.GetPicGallery.Container.Children.RemoveAt(FolderIndex);
                 }
             });
 

+ 23 - 20
PicView/FileHandling/FileFunctions.cs

@@ -1,5 +1,4 @@
-using PicView.UILogic;
-using System;
+using System;
 using System.Configuration;
 using System.Diagnostics;
 using System.Globalization;
@@ -7,6 +6,10 @@ using System.IO;
 using System.Runtime.InteropServices;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
+using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.SystemIntegration;
+using PicView.UILogic;
 
 namespace PicView.FileHandling
 {
@@ -14,9 +17,9 @@ namespace PicView.FileHandling
     {
         internal static void ShowFileProperties()
         {
-            if (ChangeImage.ErrorHandling.CheckOutOfRange()) { return; }
+            if (ErrorHandling.CheckOutOfRange()) { return; }
 
-            SystemIntegration.NativeMethods.ShowFileProperties(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex]);
+            NativeMethods.ShowFileProperties(Navigation.Pics[Navigation.FolderIndex]);
         }
 
         [DllImport("shell32.dll", SetLastError = true)]
@@ -48,7 +51,7 @@ namespace PicView.FileHandling
             }
             else
             {
-                fileArray = new IntPtr[] { nativeFile };
+                fileArray = new[] { nativeFile };
             }
 
             _= SHOpenFolderAndSelectItems(nativeFolder, (uint)fileArray.Length, fileArray, 0);
@@ -111,43 +114,43 @@ namespace PicView.FileHandling
         /// <returns></returns>
         internal static async Task<bool?> RenameFileWithErrorChecking(string newPath)
         {
-            if (!FileFunctions.RenameFile(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex], newPath))
+            if (!RenameFile(Navigation.Pics[Navigation.FolderIndex], newPath))
             {
                 return null;
             }
 
             // Check if the file is not in the same folder
-            if (Path.GetDirectoryName(newPath) != Path.GetDirectoryName(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex]))
+            if (Path.GetDirectoryName(newPath) != Path.GetDirectoryName(Navigation.Pics[Navigation.FolderIndex]))
             {
-                if (ChangeImage.Navigation.Pics.Count < 1)
+                if (Navigation.Pics.Count < 1)
                 {
-                    await ChangeImage.LoadPic.LoadPiFromFileAsync(newPath).ConfigureAwait(false);
+                    await LoadPic.LoadPiFromFileAsync(newPath).ConfigureAwait(false);
                     return false;
                 }
 
-                ChangeImage.Preloader.Remove(ChangeImage.Navigation.FolderIndex);
-                if (UC.GetPicGallery is not null && UC.GetPicGallery.Container.Children.Count > ChangeImage.Navigation.FolderIndex)
+                Preloader.Remove(Navigation.FolderIndex);
+                if (UC.GetPicGallery is not null && UC.GetPicGallery.Container.Children.Count > Navigation.FolderIndex)
                 {
-                    UC.GetPicGallery.Container.Children.RemoveAt(ChangeImage.Navigation.FolderIndex);
+                    UC.GetPicGallery.Container.Children.RemoveAt(Navigation.FolderIndex);
                 }
-                ChangeImage.Navigation.Pics.Remove(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex]);
-                await ChangeImage.Navigation.NavigateToPicAsync(false).ConfigureAwait(false);
+                Navigation.Pics.Remove(Navigation.Pics[Navigation.FolderIndex]);
+                await Navigation.NavigateToPicAsync(false).ConfigureAwait(false);
                 return false;
             }
 
-            ChangeImage.Preloader.Rename(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex], newPath);
-            if (UC.GetPicGallery is not null && UC.GetPicGallery.Container.Children.Count > ChangeImage.Navigation.FolderIndex)
+            Preloader.Rename(Navigation.Pics[Navigation.FolderIndex], newPath);
+            if (UC.GetPicGallery is not null && UC.GetPicGallery.Container.Children.Count > Navigation.FolderIndex)
             {
-                UC.GetPicGallery.Container.Children.RemoveAt(ChangeImage.Navigation.FolderIndex);
+                UC.GetPicGallery.Container.Children.RemoveAt(Navigation.FolderIndex);
             }
-            ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex] = newPath;
+            Navigation.Pics[Navigation.FolderIndex] = newPath;
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 var width = ConfigureWindows.GetMainWindow.MainImage.Source.Width;
                 var height = ConfigureWindows.GetMainWindow.MainImage.Source.Height;
 
-                SetTitle.SetTitleString((int)width, (int)height, ChangeImage.Navigation.FolderIndex, null);
+                SetTitle.SetTitleString((int)width, (int)height, Navigation.FolderIndex, null);
             });
 
             return true;

+ 11 - 10
PicView/FileHandling/FileLists.cs

@@ -1,9 +1,10 @@
-using PicView.ChangeImage;
-using System;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
+using PicView.ChangeImage;
+using PicView.Properties;
 using PicView.SystemIntegration;
 using static PicView.FileHandling.ArchiveExtraction;
 
@@ -25,7 +26,7 @@ namespace PicView.FileHandling
         /// <summary>
         /// Sort and return list of supported files
         /// </summary>
-        internal static List<string>? FileList(FileInfo fileInfo) => Properties.Settings.Default.SortPreference switch
+        internal static List<string>? FileList(FileInfo fileInfo) => Settings.Default.SortPreference switch
         {
             0 => FileList(fileInfo, SortFilesBy.Name),
             1 => FileList(fileInfo, SortFilesBy.FileSize),
@@ -51,7 +52,7 @@ namespace PicView.FileHandling
 
             SearchOption searchOption;
 
-            if (Properties.Settings.Default.IncludeSubDirectories && string.IsNullOrWhiteSpace(TempZipFile)) // Don't search subdirectories when zipped
+            if (Settings.Default.IncludeSubDirectories && string.IsNullOrWhiteSpace(TempZipFile)) // Don't search subdirectories when zipped
             {
                 searchOption = SearchOption.AllDirectories;
             }
@@ -68,7 +69,7 @@ namespace PicView.FileHandling
                 default:
                 case SortFilesBy.Name: // Alphanumeric sort
                     var list = items.ToList();
-                    if (Properties.Settings.Default.Ascending)
+                    if (Settings.Default.Ascending)
                     {
                         list.Sort((x, y) => NativeMethods.StrCmpLogicalW(x, y));
                     }
@@ -79,27 +80,27 @@ namespace PicView.FileHandling
                     return list;
 
                 case SortFilesBy.FileSize:
-                    return Properties.Settings.Default.Ascending ? 
+                    return Settings.Default.Ascending ? 
                         items.OrderBy(f => new FileInfo(f).Length).ToList()
                         : items.OrderByDescending(f => new FileInfo(f).Length).ToList();
 
                 case SortFilesBy.Extension:
-                    return Properties.Settings.Default.Ascending ?
+                    return Settings.Default.Ascending ?
                         items.OrderBy(f => new FileInfo(f).Extension).ToList()
                         : items.OrderByDescending(f => new FileInfo(f).Extension).ToList();
 
                 case SortFilesBy.Creationtime:
-                    return Properties.Settings.Default.Ascending ?
+                    return Settings.Default.Ascending ?
                         items.OrderBy(f => new FileInfo(f).CreationTime).ToList()
                         : items.OrderByDescending(f => new FileInfo(f).CreationTime).ToList();
 
                 case SortFilesBy.Lastaccesstime:
-                    return Properties.Settings.Default.Ascending ?
+                    return Settings.Default.Ascending ?
                         items.OrderBy(f => new FileInfo(f).LastAccessTime).ToList()
                         : items.OrderByDescending(f => new FileInfo(f).LastAccessTime).ToList();
 
                 case SortFilesBy.Lastwritetime:
-                    return Properties.Settings.Default.Ascending
+                    return Settings.Default.Ascending
                         ? items.OrderBy(f => new FileInfo(f).LastWriteTime).ToList()
                         : items.OrderByDescending(f => new FileInfo(f).LastWriteTime).ToList();
 

+ 11 - 10
PicView/FileHandling/Open_Save.cs

@@ -1,14 +1,15 @@
-using Microsoft.Win32;
-using Microsoft.WindowsAPICodePack.Dialogs;
-using PicView.ChangeImage;
-using PicView.ImageHandling;
-using PicView.UILogic;
-using System;
+using System;
 using System.Diagnostics;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media.Imaging;
+using System.Windows.Threading;
+using Microsoft.Win32;
+using Microsoft.WindowsAPICodePack.Dialogs;
+using PicView.ChangeImage;
+using PicView.ImageHandling;
+using PicView.UILogic;
 using static PicView.ChangeImage.ErrorHandling;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.Tooltip;
@@ -87,14 +88,14 @@ namespace PicView.FileHandling
         {
             IsDialogOpen = true;
 
-            var dlg = new OpenFileDialog()
+            var dlg = new OpenFileDialog
             {
                 Filter = FilterFiles,
                 Title = $"{Application.Current.Resources["OpenFileDialog"]} - {SetTitle.AppName}"
             };
             if (dlg.ShowDialog() == true)
             {
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                 {
                     ToggleStartUpUC(true);
                 });
@@ -154,7 +155,7 @@ namespace PicView.FileHandling
                 randomized = true;
             }
 
-            var Savedlg = new SaveFileDialog()
+            var Savedlg = new SaveFileDialog
             {
                 Filter = FilterFiles,
                 Title = Application.Current.Resources["Save"] + $" - {SetTitle.AppName}",
@@ -197,7 +198,7 @@ namespace PicView.FileHandling
                 await ReloadAsync().ConfigureAwait(false);
             }
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
                 Close_UserControls();
             });

+ 4 - 4
PicView/FileHandling/WebFunctions.cs

@@ -1,12 +1,12 @@
-using PicView.ChangeImage;
-using PicView.UILogic;
-using System;
+using System;
 using System.Diagnostics;
 using System.IO;
 using System.Net.Http;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.UILogic;
 using static PicView.ChangeImage.ErrorHandling;
 using static PicView.UILogic.Tooltip;
 
@@ -27,7 +27,7 @@ namespace PicView.FileHandling
                 SetTitle.SetLoadingString();
             });
 
-            ErrorHandling.ChangeFolder(true);
+            ChangeFolder(true);
 
             string destination;
 

+ 4 - 4
PicView/GlobalSuppressions.cs

@@ -5,10 +5,10 @@
 
 using System.Diagnostics.CodeAnalysis;
 
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.Pic(System.String)")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.Pic(System.Int32)")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.PicWeb(System.String)")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.AutoScrollTimerEvent(System.Object,System.Timers.ElapsedEventArgs)")]
+[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.Pic(System.String)")]
+[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.Pic(System.Int32)")]
+[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.PicWeb(System.String)")]
+[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.MainWindow.AutoScrollTimerEvent(System.Object,System.Timers.ElapsedEventArgs)")]
 [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.LoadFromWeb.PicWeb(System.String)")]
 [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.Open_Save.OpenWith(System.String)")]
 [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<Pending>", Scope = "member", Target = "~M:PicView.FileFunctions.RenameFile(System.String,System.String)~System.Boolean")]

+ 6 - 5
PicView/ImageHandling/Base64.cs

@@ -1,10 +1,11 @@
-using ImageMagick;
-using PicView.UILogic;
-using System;
+using System;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media.Imaging;
+using System.Windows.Threading;
+using ImageMagick;
+using PicView.UILogic;
 
 namespace PicView.ImageHandling
 {
@@ -31,7 +32,7 @@ namespace PicView.ImageHandling
         static BitmapSource? Base64FromBytes(byte[] binaryData)
         {
             using MagickImage magick = new MagickImage();
-            var mrs = new MagickReadSettings()
+            var mrs = new MagickReadSettings
             {
                 Density = new Density(300, 300),
                 BackgroundColor = MagickColors.Transparent,
@@ -63,7 +64,7 @@ namespace PicView.ImageHandling
         internal static async Task<string> ConvertToBase64()
         {
             BitmapFrame? frame = null;
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 frame = ImageDecoder.GetRenderedBitmapFrame();
             });

+ 3 - 7
PicView/ImageHandling/BatchFunctions.cs

@@ -1,12 +1,8 @@
-using ImageMagick;
-using PicView.FileHandling;
-using PicView.UILogic;
-using System;
+using System;
 using System.IO;
 using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Controls;
-using System.Windows.Threading;
+using ImageMagick;
+using PicView.FileHandling;
 
 namespace PicView.ImageHandling
 {

+ 21 - 17
PicView/ImageHandling/GetImageData.cs

@@ -1,13 +1,17 @@
-using ImageMagick;
-using Microsoft.WindowsAPICodePack.Shell;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using PicView.ChangeImage;
-using System;
+using System;
 using System.Globalization;
 using System.IO;
+using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media.Imaging;
+using System.Windows.Threading;
+using ImageMagick;
+using Microsoft.WindowsAPICodePack.Shell;
+using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
+using PicView.ChangeImage;
+using PicView.UILogic;
+using PicView.UILogic.TransformImage;
 
 namespace PicView.ImageHandling
 {
@@ -15,7 +19,7 @@ namespace PicView.ImageHandling
     {
         internal static Task<string[]?> RetrieveData(FileInfo? fileInfo) => Task.Run(async () =>
         {
-            if (fileInfo is not null && ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex] != fileInfo.FullName)
+            if (fileInfo is not null && Navigation.Pics[Navigation.FolderIndex] != fileInfo.FullName)
             {
                 return null;
             }
@@ -55,17 +59,17 @@ namespace PicView.ImageHandling
 
             BitmapSource? bitmapSource = null;
 
-            if (ChangeImage.Navigation.Pics.Count > 0 && ChangeImage.Navigation.Pics.Count > ChangeImage.Navigation.FolderIndex)
+            if (Navigation.Pics.Count > 0 && Navigation.Pics.Count > Navigation.FolderIndex)
             {
-                var preloadValue = Preloader.Get(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex]);
+                var preloadValue = Preloader.Get(Navigation.Pics[Navigation.FolderIndex]);
                 if (preloadValue is null)
                 {
-                    await Preloader.AddAsync(ChangeImage.Navigation.FolderIndex).ConfigureAwait(false);
+                    await Preloader.AddAsync(Navigation.FolderIndex).ConfigureAwait(false);
 
                     if (preloadValue is null)
                     {
                         preloadValue = new Preloader.PreloadValue(null, false, fileInfo);
-                        await UILogic.ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                        await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                         {
                             preloadValue.BitmapSource = ImageDecoder.GetRenderedBitmapFrame();
                         });
@@ -84,7 +88,7 @@ namespace PicView.ImageHandling
             }
             else
             {
-                await UILogic.ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                 {
                     bitmapSource = ImageDecoder.GetRenderedBitmapFrame();
                 });
@@ -97,8 +101,8 @@ namespace PicView.ImageHandling
             var cmWidth = inchesWidth * 2.54;
             var cmHeight = inchesHeight * 2.54;
 
-            var firstRatio = bitmapSource.PixelWidth / UILogic.TransformImage.ZoomLogic.GCD(bitmapSource.PixelWidth, bitmapSource.PixelHeight);
-            var secondRatio = bitmapSource.PixelHeight / UILogic.TransformImage.ZoomLogic.GCD(bitmapSource.PixelWidth, bitmapSource.PixelHeight);
+            var firstRatio = bitmapSource.PixelWidth / ZoomLogic.GCD(bitmapSource.PixelWidth, bitmapSource.PixelHeight);
+            var secondRatio = bitmapSource.PixelHeight / ZoomLogic.GCD(bitmapSource.PixelWidth, bitmapSource.PixelHeight);
             string ratioText;
             if (firstRatio == secondRatio)
             {
@@ -127,7 +131,7 @@ namespace PicView.ImageHandling
 
             if (fileInfo is null)
             {
-                return new string[] {
+                return new[] {
                         name,
                         directoryname,
                         fullname,
@@ -307,7 +311,7 @@ namespace PicView.ImageHandling
             }
             catch (Exception)
             {
-                return new string[] {
+                return new[] {
                         name,
                         directoryname,
                         fullname,
@@ -366,7 +370,7 @@ namespace PicView.ImageHandling
                 }
                 else if (authorsArray.Length >= 2)
                 {
-                    var sb = new System.Text.StringBuilder();
+                    var sb = new StringBuilder();
                     for (int i = 0; i < authorsArray.Length; i++)
                     {
                         if (i == 0)
@@ -669,7 +673,7 @@ namespace PicView.ImageHandling
 
             so.Dispose();
 
-            return new string[]
+            return new[]
             {
                 // Fileinfo
                 name,

+ 12 - 9
PicView/ImageHandling/ImageDecoder.cs

@@ -1,13 +1,16 @@
-using ImageMagick;
-using SkiaSharp;
-using SkiaSharp.Views.WPF;
-using System;
+using System;
 using System.Diagnostics;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using ImageMagick;
+using PicView.UILogic;
+using SkiaSharp;
+using SkiaSharp.Views.WPF;
+using Rotation = PicView.UILogic.TransformImage.Rotation;
 
 namespace PicView.ImageHandling
 {
@@ -77,12 +80,12 @@ namespace PicView.ImageHandling
                 magickImage.Quality = 100;
 
                 // Apply transformation values
-                if (UILogic.TransformImage.Rotation.Flipped)
+                if (Rotation.Flipped)
                 {
                     magickImage.Flop();
                 }
 
-                magickImage.Rotate(UILogic.TransformImage.Rotation.Rotateint);
+                magickImage.Rotate(Rotation.Rotateint);
 
                 return magickImage;
             }
@@ -103,16 +106,16 @@ namespace PicView.ImageHandling
         {
             try
             {
-                var sauce = UILogic.ConfigureWindows.GetMainWindow.MainImage.Source as BitmapSource;
+                var sauce = ConfigureWindows.GetMainWindow.MainImage.Source as BitmapSource;
 
                 if (sauce == null)
                 {
                     return null;
                 }
 
-                var effect = UILogic.ConfigureWindows.GetMainWindow.MainImage.Effect;
+                var effect = ConfigureWindows.GetMainWindow.MainImage.Effect;
 
-                var rectangle = new System.Windows.Shapes.Rectangle
+                var rectangle = new Rectangle
                 {
                     Fill = new ImageBrush(sauce),
                     Effect = effect

+ 22 - 17
PicView/ImageHandling/ImageFunctions.cs

@@ -1,12 +1,17 @@
-using ImageMagick;
-using PicView.ChangeImage;
-using PicView.UILogic;
-using PicView.UILogic.Sizing;
+using System;
 using System.Globalization;
+using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using System.Windows.Threading;
+using ImageMagick;
+using PicView.ChangeImage;
+using PicView.FileHandling;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
+using TextAlignment = System.Windows.TextAlignment;
 
 namespace PicView.ImageHandling
 {
@@ -43,7 +48,7 @@ namespace PicView.ImageHandling
 
             bool toCenter = false;
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
                 toCenter = UC.QuickSettingsMenuOpen;
                 if (toCenter is false)
@@ -58,18 +63,18 @@ namespace PicView.ImageHandling
 
             if (success)
             {
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, () =>
                 {
                     var width = ConfigureWindows.GetMainWindow.MainImage.Source.Width;
                     var height = ConfigureWindows.GetMainWindow.MainImage.Source.Height;
 
-                    SetTitle.SetTitleString((int)width, (int)height, ChangeImage.Navigation.FolderIndex, null);
+                    SetTitle.SetTitleString((int)width, (int)height, Navigation.FolderIndex, null);
                     Tooltip.CloseToolTipMessage();
                 });
             }
             else
             {
-                Tooltip.ShowTooltipMessage($"0%", toCenter);
+                Tooltip.ShowTooltipMessage("0%", toCenter);
                 return;
             }
 
@@ -79,23 +84,23 @@ namespace PicView.ImageHandling
                 await Preloader.AddAsync(Navigation.FolderIndex).ConfigureAwait(false);
             }
 
-            var fileInfo = new System.IO.FileInfo(Navigation.Pics[Navigation.FolderIndex]);
-            var readablePrevSize = FileHandling.FileFunctions.GetSizeReadable(preloadValue.FileInfo.Length);
-            var readableNewSize = FileHandling.FileFunctions.GetSizeReadable(fileInfo.Length);
+            var fileInfo = new FileInfo(Navigation.Pics[Navigation.FolderIndex]);
+            var readablePrevSize = FileFunctions.GetSizeReadable(preloadValue.FileInfo.Length);
+            var readableNewSize = FileFunctions.GetSizeReadable(fileInfo.Length);
 
             var originalValue = preloadValue.FileInfo.Length;
             var decreasedValue = fileInfo.Length;
             if (originalValue != decreasedValue)
             {
                 var percentDecrease = ((float)(originalValue - decreasedValue) / decreasedValue) * 100;
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, () =>
                 {
-                    Tooltip.ShowTooltipMessage($"{readablePrevSize} > {readableNewSize} = {percentDecrease.ToString("0.## ", CultureInfo.CurrentCulture)}%", toCenter, System.TimeSpan.FromSeconds(3.5));
+                    Tooltip.ShowTooltipMessage($"{readablePrevSize} > {readableNewSize} = {percentDecrease.ToString("0.## ", CultureInfo.CurrentCulture)}%", toCenter, TimeSpan.FromSeconds(3.5));
                 });
             }
             else
             {
-                Tooltip.ShowTooltipMessage($"0%", toCenter);
+                Tooltip.ShowTooltipMessage("0%", toCenter);
             }
 
         }
@@ -116,7 +121,7 @@ namespace PicView.ImageHandling
             {
                 return imageOptimizer.LosslessCompress(file);
             }
-            catch (System.Exception)
+            catch (Exception)
             {
                 return false;
             }
@@ -140,7 +145,7 @@ namespace PicView.ImageHandling
                     //text
                     var text = new FormattedText("Unable to render image", CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, typeface, 16, brush, WindowSizing.MonitorInfo.DpiScaling)
                     {
-                        TextAlignment = System.Windows.TextAlignment.Center
+                        TextAlignment = TextAlignment.Center
                     };
 
                     ctx.DrawText(text, new Point(rect.Left + rect.Width / 2, rect.Top + rect.Height / 2));
@@ -150,7 +155,7 @@ namespace PicView.ImageHandling
                 rtv.Freeze();
                 return rtv;
             }
-            catch (System.Exception)
+            catch (Exception)
             {
                 return null;
             }

+ 4 - 3
PicView/ImageHandling/ImageSizeFunctions.cs

@@ -1,8 +1,9 @@
-using ImageMagick;
+using System;
 using System.Diagnostics;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
+using ImageMagick;
 
 namespace PicView.ImageHandling
 {
@@ -47,7 +48,7 @@ namespace PicView.ImageHandling
             if (File.Exists(file) == false) { return false; }
             if (width < 0 && percentage is not null || height < 0 && percentage is not null) { return false; }
 
-            var magick = new MagickImage()
+            var magick = new MagickImage
             {
                 ColorSpace = ColorSpace.Transparent
             };
@@ -129,7 +130,7 @@ namespace PicView.ImageHandling
             {
                 imageOptimizer.Compress(x);
             }
-            catch (System.Exception)
+            catch (Exception)
             {
                 return true;
             }

+ 6 - 5
PicView/ImageHandling/SaveImages.cs

@@ -1,10 +1,11 @@
-using ImageMagick;
-using PicView.UILogic;
-using System;
+using System;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media.Imaging;
+using System.Windows.Threading;
+using ImageMagick;
+using PicView.UILogic;
 
 namespace PicView.ImageHandling
 {
@@ -17,7 +18,7 @@ namespace PicView.ImageHandling
             {
                 if (hlsl)
                 {
-                    await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                    await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                     {
                         magickImage = ImageDecoder.GetRenderedMagickImage();
                     });
@@ -27,7 +28,7 @@ namespace PicView.ImageHandling
                 {
                     var encoder = new PngBitmapEncoder();
 
-                    await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                    await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                     {
                         encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
                     });

+ 7 - 7
PicView/ImageHandling/Thumbnails.cs

@@ -1,9 +1,11 @@
-using ImageMagick;
-using PicView.Views.UserControls;
-using System;
+using System;
 using System.Diagnostics;
 using System.IO;
 using System.Windows.Media.Imaging;
+using ImageMagick;
+using Microsoft.WindowsAPICodePack.Shell;
+using PicView.ChangeImage;
+using PicView.Views.UserControls;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.UC;
 
@@ -18,7 +20,7 @@ namespace PicView.ImageHandling
         /// <returns></returns>
         internal static BitmapSource? GetThumb(int x, FileInfo? fileInfo = null)
         {
-            if (ChangeImage.ErrorHandling.CheckOutOfRange())
+            if (ErrorHandling.CheckOutOfRange())
             {
                 return null;
             }
@@ -66,8 +68,6 @@ namespace PicView.ImageHandling
                 case ".jfif":
                 case ".wbmp":
                     return GetWindowsThumbnail(fileInfo.FullName);
-                default:
-                    break;
             }
 
             if (checkSize)
@@ -130,7 +130,7 @@ namespace PicView.ImageHandling
         /// <returns></returns>
         private static BitmapSource GetWindowsThumbnail(string path)
         {
-            BitmapSource pic = Microsoft.WindowsAPICodePack.Shell.ShellFile.FromFilePath(path).Thumbnail.BitmapSource;
+            BitmapSource pic = ShellFile.FromFilePath(path).Thumbnail.BitmapSource;
             pic.Freeze();
             return pic;
         }

+ 20 - 15
PicView/PicGallery/GalleryClick.cs

@@ -1,11 +1,16 @@
-using PicView.ChangeImage;
-using PicView.UILogic;
-using System;
+using System;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Media.Animation;
+using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.ConfigureSettings;
+using PicView.ImageHandling;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.Views.UserControls;
 using static PicView.ChangeImage.Navigation;
 using static PicView.ImageHandling.Thumbnails;
 using static PicView.UILogic.Sizing.ScaleImage;
@@ -31,22 +36,22 @@ namespace PicView.PicGallery
 
             ConfigureWindows.GetMainWindow.MainImage.Visibility = Visibility.Hidden;
 
-            var z = GetPicGallery.Container.Children[id] as Views.UserControls.PicGalleryItem;
+            var z = GetPicGallery.Container.Children[id] as PicGalleryItem;
             ConfigureWindows.GetMainWindow.MainImage.Source = z.img.Source;
             Border? border = null;
             Image? image = null;
-            var size = await ImageHandling.ImageSizeFunctions.GetImageSizeAsync(Pics[id]).ConfigureAwait(true);
+            var size = await ImageSizeFunctions.GetImageSizeAsync(Pics[id]).ConfigureAwait(true);
             if (size.HasValue)
             {
                 GalleryFunctions.IsHorizontalOpen = false;
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Send, () =>
                 {
                     FitImage(size.Value.Width, size.Value.Height);
                 });
             }
 
             var from = GalleryNavigation.PicGalleryItem_Size;
-            var to = new double[] { XWidth, XHeight };
+            var to = new[] { XWidth, XHeight };
             var acceleration = 0.2;
             var deceleration = 0.4;
             var duration = TimeSpan.FromSeconds(.3);
@@ -73,7 +78,7 @@ namespace PicView.PicGallery
 
             da.Completed += async delegate
             {
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                 {
                     border.Opacity = 0;
                     GetPicGallery.grid.Children.Remove(border);
@@ -85,9 +90,9 @@ namespace PicView.PicGallery
                 await ItemClickAsync(id, false).ConfigureAwait(false);
             };
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
-                if (Properties.Settings.Default.AutoFitWindow)
+                if (Settings.Default.AutoFitWindow)
                 {
                     GetPicGallery.Width = XWidth;
                     GetPicGallery.Height = XHeight;
@@ -108,7 +113,7 @@ namespace PicView.PicGallery
 
                 GetPicGallery.x2.Visibility = Visibility.Hidden;
 
-                image = new Image()
+                image = new Image
                 {
                     Source = GetThumb(id),
                     Stretch = Stretch.Fill,
@@ -117,9 +122,9 @@ namespace PicView.PicGallery
                 };
 
                 // Need to add border for background to pictures with transparent background
-                border = new Border()
+                border = new Border
                 {
-                    Background = ConfigureSettings.ConfigColors.BackgroundColorBrush
+                    Background = ConfigColors.BackgroundColorBrush
                 };
                 border.Child = image;
                 GetPicGallery.grid.Children.Add(border);
@@ -131,14 +136,14 @@ namespace PicView.PicGallery
 
         internal static async Task ItemClickAsync(int id, bool resize = true)
         {
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
                 // Deselect current item
                 GalleryNavigation.SetSelected(GalleryNavigation.SelectedGalleryItem, false);
                 GalleryNavigation.SetSelected(FolderIndex, false);
 
                 // Restore interface elements if needed
-                if (!Properties.Settings.Default.ShowInterface || Properties.Settings.Default.Fullscreen && Properties.Settings.Default.ShowAltInterfaceButtons)
+                if (!Settings.Default.ShowInterface || Settings.Default.Fullscreen && Settings.Default.ShowAltInterfaceButtons)
                 {
                     HideInterfaceLogic.ShowNavigation(true);
                     HideInterfaceLogic.ShowShortcuts(true);

+ 7 - 7
PicView/PicGallery/GalleryFunctions.cs

@@ -1,7 +1,4 @@
-using PicView.ChangeImage;
-using PicView.UILogic;
-using PicView.Views.UserControls;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
@@ -9,6 +6,10 @@ using System.Linq;
 using System.Threading.Tasks;
 using System.Windows.Media.Imaging;
 using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.FileHandling;
+using PicView.UILogic;
+using PicView.Views.UserControls;
 using static PicView.UILogic.UC;
 
 namespace PicView.PicGallery
@@ -46,7 +47,6 @@ namespace PicView.PicGallery
             {
                 if (GetPicGallery.Container.Children.Count <= 0)
                 {
-                    return;
                 }
             }));
 
@@ -55,7 +55,7 @@ namespace PicView.PicGallery
                 fileInfo = new FileInfo(Navigation.Pics[0]);
             }
 
-            var thumbs = new System.Collections.Generic.List<tempPics>();
+            var thumbs = new List<tempPics>();
 
             await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() =>
             {
@@ -69,7 +69,7 @@ namespace PicView.PicGallery
             }));
 
             Navigation.Pics.Clear(); // Cancel task if running
-            await FileHandling.FileLists.RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
+            await FileLists.RetrieveFilelistAsync(fileInfo).ConfigureAwait(false);
 
             try
             {

+ 15 - 11
PicView/PicGallery/GalleryLoad.cs

@@ -1,9 +1,5 @@
-using PicView.ChangeImage;
-using PicView.ImageHandling;
-using PicView.UILogic;
-using PicView.UILogic.Sizing;
-using PicView.Views.UserControls;
-using System;
+using System;
+using System.IO;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
@@ -11,6 +7,12 @@ using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.ImageHandling;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
+using PicView.Views.UserControls;
 using static PicView.UILogic.HideInterfaceLogic;
 
 namespace PicView.PicGallery
@@ -44,7 +46,7 @@ namespace PicView.PicGallery
             {
                 WindowSizing.RenderFullscreen();
 
-                if (Properties.Settings.Default.FullscreenGalleryHorizontal)
+                if (Settings.Default.FullscreenGalleryHorizontal)
                 {
                     // Set size
                     GalleryNavigation.SetSize(22);
@@ -88,7 +90,7 @@ namespace PicView.PicGallery
                     // Set style
                     UC.GetPicGallery.Margin = new Thickness(0, 0, 0, 0);
                     UC.GetPicGallery.border.BorderThickness = new Thickness(1, 0, 0, 0);
-                    if (Properties.Settings.Default.DarkTheme)
+                    if (Settings.Default.DarkTheme)
                     {
                         UC.GetPicGallery.border.Background = (SolidColorBrush)Application.Current.Resources["BackgroundColorBrushFade"];
                     }
@@ -234,7 +236,7 @@ namespace PicView.PicGallery
             }
 
             var pic = await Task.FromResult(
-                Thumbnails.GetBitmapSourceThumb(new System.IO.FileInfo(Navigation.Pics[i]), 70, (int)GalleryNavigation.PicGalleryItem_Size)
+                Thumbnails.GetBitmapSourceThumb(new FileInfo(Navigation.Pics[i]), 70, (int)GalleryNavigation.PicGalleryItem_Size)
                 ?? ImageFunctions.ImageErrorMessage());
             UpdatePic(i, pic);
         }
@@ -254,9 +256,11 @@ namespace PicView.PicGallery
                     
                     var item = (PicGalleryItem)UC.GetPicGallery.Container.Children[i];
                     item.img.Source = pic;
+                    
+                    item.Width = item.Border.Width = GalleryNavigation.PicGalleryItem_Size * pic.PixelWidth / pic.PixelHeight;
+                    item.Height = item.Border.Height = GalleryNavigation.PicGalleryItem_Size;
 
-                    item.Width =  GalleryNavigation.PicGalleryItem_Size * pic.PixelWidth / pic.PixelHeight;
-                    item.Height = GalleryNavigation.PicGalleryItem_Size;
+                    
                 }));
             }
             catch (Exception)

+ 19 - 23
PicView/PicGallery/GalleryNavigation.cs

@@ -1,8 +1,11 @@
-using PicView.UILogic;
-using System;
+using System;
 using System.Windows;
 using System.Windows.Input;
 using System.Windows.Media;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
+using PicView.Views.UserControls;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.UC;
 
@@ -14,9 +17,9 @@ namespace PicView.PicGallery
 
         internal static void SetSize(int numberOfItems)
         {
-            GalleryNavigation.PicGalleryItem_Size = UILogic.Sizing.WindowSizing.MonitorInfo.WorkArea.Width / numberOfItems;
+            PicGalleryItem_Size = WindowSizing.MonitorInfo.WorkArea.Width / numberOfItems;
 
-            GalleryNavigation.PicGalleryItem_Size_s = GalleryNavigation.PicGalleryItem_Size - 30;
+            PicGalleryItem_Size_s = PicGalleryItem_Size - 30;
         }
 
         internal static double PicGalleryItem_Size { get; private set; }
@@ -68,25 +71,20 @@ namespace PicView.PicGallery
         /// <summary>
         /// Scrolls to center of current item
         /// </summary>
-        /// <param name="item">The index of picGalleryItem</param>
         internal static void ScrollTo()
         {
             if (GetPicGallery == null || PicGalleryItem_Size < 1) { return; }
 
             if (GalleryFunctions.IsHorizontalOpen)
             {
-                if (GetPicGallery.Container.Children.Count < FolderIndex)
-                {
-                    return;
-                }
+                if (GetPicGallery.Container.Children.Count < FolderIndex) { return; }
+                
                 var selectedScrollTo = GetPicGallery.Container.Children[FolderIndex].TranslatePoint(new Point(), GetPicGallery.Container);
                 GetPicGallery.Scroller.ScrollToHorizontalOffset(selectedScrollTo.X - (Horizontal_items / 2) * PicGalleryItem_Size + (PicGalleryItem_Size_s / 2));
 
-                if (SelectedGalleryItem != FolderIndex)
-                {
-                    SetSelected(SelectedGalleryItem, false);
-                    SelectedGalleryItem = FolderIndex;
-                }
+                if (SelectedGalleryItem == FolderIndex) { return; }
+                SetSelected(SelectedGalleryItem, false);
+                SelectedGalleryItem = FolderIndex;
             }
             else if (GalleryFunctions.IsHorizontalFullscreenOpen)
             {
@@ -106,7 +104,7 @@ namespace PicView.PicGallery
             }
             else
             {
-                ScrollTo(e.Delta > 0, false);
+                ScrollTo(e.Delta > 0);
             }
         }
 
@@ -141,7 +139,7 @@ namespace PicView.PicGallery
                 {
                     if (next)
                     {
-                        if (Properties.Settings.Default.FullscreenGalleryVertical)
+                        if (Settings.Default.FullscreenGalleryVertical)
                         {
                             GetPicGallery.Scroller.ScrollToVerticalOffset(GetPicGallery.Scroller.VerticalOffset - speed);
                         }
@@ -152,7 +150,7 @@ namespace PicView.PicGallery
                     }
                     else
                     {
-                        if (Properties.Settings.Default.FullscreenGalleryVertical)
+                        if (Settings.Default.FullscreenGalleryVertical)
                         {
                             GetPicGallery.Scroller.ScrollToVerticalOffset(GetPicGallery.Scroller.VerticalOffset + speed);
                         }
@@ -181,17 +179,17 @@ namespace PicView.PicGallery
                 if (GetPicGallery is not null && x > GetPicGallery.Container.Children.Count - 1 || x < 0) { return; }
 
                 // Select next item
-                var nextItem = GetPicGallery.Container.Children[x] as Views.UserControls.PicGalleryItem;
+                var nextItem = GetPicGallery.Container.Children[x] as PicGalleryItem;
 
                 if (selected)
                 {
                     nextItem.Border.BorderBrush = Application.Current.Resources["ChosenColorBrush"] as SolidColorBrush;
-                    nextItem.Border.Height = PicGalleryItem_Size;
+                    //nextItem.Border.Height = PicGalleryItem_Size;
                 }
                 else
                 {
                     nextItem.Border.BorderBrush = Application.Current.Resources["BorderBrush"] as SolidColorBrush;
-                    nextItem.Border.Height = PicGalleryItem_Size_s;
+                    //nextItem.Border.Height = PicGalleryItem_Size_s;
                 }
             });
         }
@@ -227,8 +225,6 @@ namespace PicView.PicGallery
                 case Direction.Right:
                     SelectedGalleryItem = SelectedGalleryItem + Vertical_items;
                     break;
-                default:
-                    break;
             }
 
             if (SelectedGalleryItem >= Pics.Count - 1)
@@ -263,7 +259,7 @@ namespace PicView.PicGallery
             SetSelected(FolderIndex, true);
             SelectedGalleryItem = FolderIndex;
 
-            if (Properties.Settings.Default.FullscreenGalleryHorizontal)
+            if (Settings.Default.FullscreenGalleryHorizontal)
             {
                 GetPicGallery.Scroller.ScrollToHorizontalOffset(CenterScrollPosition);
             }

+ 35 - 36
PicView/PicGallery/GalleryToggle.cs

@@ -1,12 +1,15 @@
-using PicView.Animations;
-using PicView.UILogic;
-using PicView.Views.UserControls.Gallery;
-using PicView.Views.Windows;
-using System;
+using System;
 using System.Linq;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media.Animation;
+using System.Windows.Threading;
+using PicView.Animations;
+using PicView.ConfigureSettings;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
+using PicView.Views.UserControls.Gallery;
 using static PicView.ChangeImage.Navigation;
 using static PicView.PicGallery.GalleryFunctions;
 using static PicView.UILogic.ConfigureWindows;
@@ -28,7 +31,7 @@ namespace PicView.PicGallery
             IsHorizontalOpen = true;
             IsHorizontalFullscreenOpen = IsHorizontalOpen = false;
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, () =>
+            await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, () =>
             {
                 GalleryLoad.LoadLayout(false);
                 GetPicGallery.Visibility = Visibility.Visible;
@@ -57,42 +60,38 @@ namespace PicView.PicGallery
                 return;
             }
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
                 GalleryLoad.LoadLayout(true);
                 GetPicGallery.Visibility = Visibility.Visible;
 
-                if (Properties.Settings.Default.FullscreenGalleryHorizontal)
+                if (Settings.Default.FullscreenGalleryHorizontal)
                 {
                     IsHorizontalFullscreenOpen = true;
                     IsVerticalFullscreenOpen = IsHorizontalOpen = false;
 
-                    var check = from x in ConfigureWindows.GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtons>()
+                    var check = from x in GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtons>()
                                 select x;
                     foreach (var item in check)
                     {
-                        ConfigureWindows.GetMainWindow.ParentContainer.Children.Remove(item);
+                        GetMainWindow.ParentContainer.Children.Remove(item);
                     }
 
-                    ConfigureWindows.GetMainWindow.ParentContainer.Children.Add(new PicGalleryTopButtonsV2
-                    {
-                    });
+                    GetMainWindow.ParentContainer.Children.Add(new PicGalleryTopButtonsV2());
                 }
                 else
                 {
                     IsVerticalFullscreenOpen = true;
                     IsHorizontalFullscreenOpen = IsHorizontalOpen = false;
 
-                    var check = from x in ConfigureWindows.GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtonsV2>()
+                    var check = from x in GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtonsV2>()
                                 select x;
                     foreach (var item in check)
                     {
-                        ConfigureWindows.GetMainWindow.ParentContainer.Children.Remove(item);
+                        GetMainWindow.ParentContainer.Children.Remove(item);
                     }
 
-                    ConfigureWindows.GetMainWindow.ParentContainer.Children.Add(new PicGalleryTopButtons
-                    {
-                    });
+                    GetMainWindow.ParentContainer.Children.Add(new PicGalleryTopButtons());
                 }
 
                 GetMainWindow.Focus();
@@ -105,7 +104,7 @@ namespace PicView.PicGallery
 
             if (startup == false)
             {
-                await UILogic.Sizing.ScaleImage.TryFitImageAsync().ConfigureAwait(false);
+                await ScaleImage.TryFitImageAsync().ConfigureAwait(false);
             }
 
             await LoadAndScrollToAsync().ConfigureAwait(false);
@@ -117,11 +116,11 @@ namespace PicView.PicGallery
 
         internal static void CloseCurrentGallery()
         {
-            if (GalleryFunctions.IsVerticalFullscreenOpen || GalleryFunctions.IsHorizontalFullscreenOpen)
+            if (IsVerticalFullscreenOpen || IsHorizontalFullscreenOpen)
             {
                 CloseFullscreenGallery();
             }
-            else if (GalleryFunctions.IsHorizontalOpen)
+            else if (IsHorizontalOpen)
             {
                 CloseHorizontalGallery();
             }
@@ -129,12 +128,12 @@ namespace PicView.PicGallery
 
         internal static void CloseHorizontalGallery()
         {
-            if (UC.GetPicGallery is null) { return; }
+            if (GetPicGallery is null) { return; }
 
             IsVerticalFullscreenOpen = IsHorizontalFullscreenOpen = IsHorizontalOpen = false;
 
             // Restore interface elements if needed
-            if (!Properties.Settings.Default.ShowInterface || Properties.Settings.Default.Fullscreen)
+            if (!Settings.Default.ShowInterface || Settings.Default.Fullscreen)
             {
                 HideInterfaceLogic.ShowNavigation(true);
                 HideInterfaceLogic.ShowShortcuts(true);
@@ -161,40 +160,40 @@ namespace PicView.PicGallery
 
             GetPicGallery.Visibility = Visibility.Collapsed;
 
-            ConfigureSettings.ConfigColors.UpdateColor();
+            ConfigColors.UpdateColor();
 
             HideInterfaceLogic.ShowStandardInterface();
             GetPicGallery.x2.Visibility = Visibility.Collapsed;
 
             // Restore settings
-            UILogic.Sizing.WindowSizing.SetWindowBehavior();
+            WindowSizing.SetWindowBehavior();
 
-            if (Properties.Settings.Default.AutoFitWindow)
+            if (Settings.Default.AutoFitWindow)
             {
-                UILogic.Sizing.WindowSizing.CenterWindowOnScreen();
+                WindowSizing.CenterWindowOnScreen();
             }
             else
             {
-                UILogic.Sizing.WindowSizing.SetLastWindowSize();
+                WindowSizing.SetLastWindowSize();
             }
 
             if (GetMainWindow.MainImage.Source is not null)
             {
-                UILogic.Sizing.ScaleImage.FitImage(GetMainWindow.MainImage.Source.Width, GetMainWindow.MainImage.Source.Height);
+                ScaleImage.FitImage(GetMainWindow.MainImage.Source.Width, GetMainWindow.MainImage.Source.Height);
             }
 
-            var check = from x in ConfigureWindows.GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtons>()
+            var check = from x in GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtons>()
                         select x;
             if (check.Any())
             {
-                ConfigureWindows.GetMainWindow.ParentContainer.Children.Remove(check.ElementAt(0));
+                GetMainWindow.ParentContainer.Children.Remove(check.ElementAt(0));
             }
 
-            var check2 = from x in ConfigureWindows.GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtonsV2>()
+            var check2 = from x in GetMainWindow.ParentContainer.Children.OfType<PicGalleryTopButtonsV2>()
                          select x;
             if (check2.Any())
             {
-                ConfigureWindows.GetMainWindow.ParentContainer.Children.Remove(check2.ElementAt(0));
+                GetMainWindow.ParentContainer.Children.Remove(check2.ElementAt(0));
             }
         }
 
@@ -205,9 +204,9 @@ namespace PicView.PicGallery
             if (GalleryLoad.IsLoading == false)
             {
                 bool checkLoad = false;
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                 {
-                    if (GetPicGallery.Container.Children.Count == ChangeImage.Navigation.Pics.Count)
+                    if (GetPicGallery.Container.Children.Count == Pics.Count)
                     {
                         checkLoad = true;
                     }
@@ -220,7 +219,7 @@ namespace PicView.PicGallery
 
             try
             {
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, () =>
+                await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, () =>
                 {
                     GalleryNavigation.ScrollTo();
                 });

+ 4 - 3
PicView/ProcessHandling/ProcessLogic.cs

@@ -1,7 +1,8 @@
-using PicView.ChangeImage;
+using System;
 using System.Diagnostics;
 using System.IO;
 using System.Windows;
+using PicView.ChangeImage;
 
 namespace PicView.ProcessHandling
 {
@@ -24,11 +25,11 @@ namespace PicView.ProcessHandling
         }
         internal static string? GetPathToProcess()
         {
-            var GetAppPath = System.Environment.ProcessPath;
+            var GetAppPath = Environment.ProcessPath;
 
             if (Path.GetExtension(GetAppPath) == ".dll")
             {
-                GetAppPath = GetAppPath?.Replace(".dll", ".exe", System.StringComparison.InvariantCultureIgnoreCase);
+                GetAppPath = GetAppPath?.Replace(".dll", ".exe", StringComparison.InvariantCultureIgnoreCase);
             }
             return GetAppPath;
         }

+ 20 - 15
PicView/Properties/Resources.Designer.cs

@@ -8,10 +8,15 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
+using System.CodeDom.Compiler;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using System.Resources;
+using System.Runtime.CompilerServices;
+
 namespace PicView.Properties {
-    using System;
-    
-    
     /// <summary>
     ///   A strongly-typed resource class, for looking up localized strings, etc.
     /// </summary>
@@ -19,27 +24,27 @@ namespace PicView.Properties {
     // class via a tool like ResGen or Visual Studio.
     // To add or remove a member, edit your .ResX file then rerun ResGen
     // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [DebuggerNonUserCode()]
+    [CompilerGenerated()]
     internal class Resources {
         
-        private static global::System.Resources.ResourceManager resourceMan;
+        private static ResourceManager resourceMan;
         
-        private static global::System.Globalization.CultureInfo resourceCulture;
+        private static CultureInfo resourceCulture;
         
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
         internal Resources() {
         }
         
         /// <summary>
         ///   Returns the cached ResourceManager instance used by this class.
         /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
+        [EditorBrowsable(EditorBrowsableState.Advanced)]
+        internal static ResourceManager ResourceManager {
             get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PicView.Properties.Resources", typeof(Resources).Assembly);
+                if (ReferenceEquals(resourceMan, null)) {
+                    ResourceManager temp = new ResourceManager("PicView.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
@@ -50,8 +55,8 @@ namespace PicView.Properties {
         ///   Overrides the current thread's CurrentUICulture property for all
         ///   resource lookups using this strongly typed resource class.
         /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
+        [EditorBrowsable(EditorBrowsableState.Advanced)]
+        internal static CultureInfo Culture {
             get {
                 return resourceCulture;
             }

+ 157 - 151
PicView/Properties/Settings.Designer.cs

@@ -8,14 +8,20 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
+using System.CodeDom.Compiler;
+using System.Configuration;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Windows.Media;
+
 namespace PicView.Properties {
     
     
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
-    public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+    [CompilerGenerated()]
+    [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
+    public sealed partial class Settings : ApplicationSettingsBase {
         
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
         
         public static Settings Default {
             get {
@@ -23,141 +29,141 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FF0461B1")]
-        public global::System.Windows.Media.Color Blue {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FF0461B1")]
+        public Color Blue {
             get {
-                return ((global::System.Windows.Media.Color)(this["Blue"]));
+                return ((Color)(this["Blue"]));
             }
             set {
                 this["Blue"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FFE68BEE")]
-        public global::System.Windows.Media.Color Pink {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FFE68BEE")]
+        public Color Pink {
             get {
-                return ((global::System.Windows.Media.Color)(this["Pink"]));
+                return ((Color)(this["Pink"]));
             }
             set {
                 this["Pink"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FFDB5B3D")]
-        public global::System.Windows.Media.Color Orange {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FFDB5B3D")]
+        public Color Orange {
             get {
-                return ((global::System.Windows.Media.Color)(this["Orange"]));
+                return ((Color)(this["Orange"]));
             }
             set {
                 this["Orange"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FF0EB24C")]
-        public global::System.Windows.Media.Color Green {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FF0EB24C")]
+        public Color Green {
             get {
-                return ((global::System.Windows.Media.Color)(this["Green"]));
+                return ((Color)(this["Green"]));
             }
             set {
                 this["Green"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FFF91110")]
-        public global::System.Windows.Media.Color Red {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FFF91110")]
+        public Color Red {
             get {
-                return ((global::System.Windows.Media.Color)(this["Red"]));
+                return ((Color)(this["Red"]));
             }
             set {
                 this["Red"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FF36E6CC")]
-        public global::System.Windows.Media.Color Aqua {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FF36E6CC")]
+        public Color Aqua {
             get {
-                return ((global::System.Windows.Media.Color)(this["Aqua"]));
+                return ((Color)(this["Aqua"]));
             }
             set {
                 this["Aqua"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FFFEA955")]
-        public global::System.Windows.Media.Color Golden {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FFFEA955")]
+        public Color Golden {
             get {
-                return ((global::System.Windows.Media.Color)(this["Golden"]));
+                return ((Color)(this["Golden"]));
             }
             set {
                 this["Golden"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FF44A1A0")]
-        public global::System.Windows.Media.Color Teal {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FF44A1A0")]
+        public Color Teal {
             get {
-                return ((global::System.Windows.Media.Color)(this["Teal"]));
+                return ((Color)(this["Teal"]));
             }
             set {
                 this["Teal"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FF9738EB")]
-        public global::System.Windows.Media.Color Purple {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FF9738EB")]
+        public Color Purple {
             get {
-                return ((global::System.Windows.Media.Color)(this["Purple"]));
+                return ((Color)(this["Purple"]));
             }
             set {
                 this["Purple"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FF1BA1E2")]
-        public global::System.Windows.Media.Color Cyan {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FF1BA1E2")]
+        public Color Cyan {
             get {
-                return ((global::System.Windows.Media.Color)(this["Cyan"]));
+                return ((Color)(this["Cyan"]));
             }
             set {
                 this["Cyan"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FF22CB97")]
-        public global::System.Windows.Media.Color Lime {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FF22CB97")]
+        public Color Lime {
             get {
-                return ((global::System.Windows.Media.Color)(this["Lime"]));
+                return ((Color)(this["Lime"]));
             }
             set {
                 this["Lime"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool CallUpgrade {
             get {
                 return ((bool)(this["CallUpgrade"]));
@@ -167,21 +173,21 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("#FFFF35C5")]
-        public global::System.Windows.Media.Color Magenta {
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("#FFFF35C5")]
+        public Color Magenta {
             get {
-                return ((global::System.Windows.Media.Color)(this["Magenta"]));
+                return ((Color)(this["Magenta"]));
             }
             set {
                 this["Magenta"] = value;
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool ScrollEnabled {
             get {
                 return ((bool)(this["ScrollEnabled"]));
@@ -191,9 +197,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool ShowInterface {
             get {
                 return ((bool)(this["ShowInterface"]));
@@ -203,9 +209,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("0")]
         public int SortPreference {
             get {
                 return ((int)(this["SortPreference"]));
@@ -215,9 +221,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool FullscreenGalleryHorizontal {
             get {
                 return ((bool)(this["FullscreenGalleryHorizontal"]));
@@ -227,9 +233,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("5000")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("5000")]
         public double SlideTimer {
             get {
                 return ((double)(this["SlideTimer"]));
@@ -239,9 +245,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool Looping {
             get {
                 return ((bool)(this["Looping"]));
@@ -251,9 +257,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("0")]
         public int BgColorChoice {
             get {
                 return ((int)(this["BgColorChoice"]));
@@ -263,9 +269,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool AutoFitWindow {
             get {
                 return ((bool)(this["AutoFitWindow"]));
@@ -275,9 +281,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool FillImage {
             get {
                 return ((bool)(this["FillImage"]));
@@ -287,9 +293,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("0")]
         public double Top {
             get {
                 return ((double)(this["Top"]));
@@ -299,9 +305,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("0")]
         public double Left {
             get {
                 return ((double)(this["Left"]));
@@ -311,9 +317,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("0")]
         public double Height {
             get {
                 return ((double)(this["Height"]));
@@ -323,9 +329,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("0")]
         public double Width {
             get {
                 return ((double)(this["Width"]));
@@ -335,9 +341,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool Fullscreen {
             get {
                 return ((bool)(this["Fullscreen"]));
@@ -347,9 +353,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool IncludeSubDirectories {
             get {
                 return ((bool)(this["IncludeSubDirectories"]));
@@ -359,9 +365,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool DarkTheme {
             get {
                 return ((bool)(this["DarkTheme"]));
@@ -371,9 +377,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("en")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("en")]
         public string UserLanguage {
             get {
                 return ((string)(this["UserLanguage"]));
@@ -383,9 +389,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool ShowAltInterfaceButtons {
             get {
                 return ((bool)(this["ShowAltInterfaceButtons"]));
@@ -395,9 +401,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("3")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("3")]
         public int ColorTheme {
             get {
                 return ((int)(this["ColorTheme"]));
@@ -407,9 +413,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("0.2")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("0.2")]
         public double ZoomSpeed {
             get {
                 return ((double)(this["ZoomSpeed"]));
@@ -419,9 +425,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool TopMost {
             get {
                 return ((bool)(this["TopMost"]));
@@ -431,9 +437,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool KeepCentered {
             get {
                 return ((bool)(this["KeepCentered"]));
@@ -443,9 +449,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool CtrlZoom {
             get {
                 return ((bool)(this["CtrlZoom"]));
@@ -455,9 +461,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool FullscreenGalleryVertical {
             get {
                 return ((bool)(this["FullscreenGalleryVertical"]));
@@ -467,9 +473,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool StartInFullscreenGallery {
             get {
                 return ((bool)(this["StartInFullscreenGallery"]));
@@ -479,9 +485,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("False")]
         public bool Maximized {
             get {
                 return ((bool)(this["Maximized"]));
@@ -491,9 +497,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool Ascending {
             get {
                 return ((bool)(this["Ascending"]));
@@ -503,9 +509,9 @@ namespace PicView.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        [UserScopedSetting()]
+        [DebuggerNonUserCode()]
+        [DefaultSettingValue("True")]
         public bool HorizontalReverseScroll {
             get {
                 return ((bool)(this["HorizontalReverseScroll"]));

+ 4 - 3
PicView/Shortcuts/CustomTextBoxShortcuts.cs

@@ -1,6 +1,7 @@
-using PicView.UILogic;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
 using System.Windows.Input;
+using PicView.FileHandling;
+using PicView.UILogic;
 
 namespace PicView
 {
@@ -15,7 +16,7 @@ namespace PicView
             else if (e.Key == Key.Escape)
             {
                 EditTitleBar.Refocus();
-                FileHandling.Open_Save.IsDialogOpen = true; // Hack to make escape not fall through
+                Open_Save.IsDialogOpen = true; // Hack to make escape not fall through
             }
         }
     }

+ 2 - 3
PicView/Shortcuts/GenericWindowShortcuts.cs

@@ -1,6 +1,7 @@
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
+using PicView.UILogic;
 
 namespace PicView.Shortcuts
 {
@@ -12,7 +13,7 @@ namespace PicView.Shortcuts
             {
                 case Key.Escape:
                     window.Hide();
-                    UILogic.ConfigureWindows.GetMainWindow.Focus();
+                    ConfigureWindows.GetMainWindow.Focus();
                     break;
 
                 case Key.S:
@@ -26,8 +27,6 @@ namespace PicView.Shortcuts
                     if (scrollViewer == null) { return; }
                     scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - 10);
                     break;
-
-                default: break;
             }
         }
 

+ 38 - 38
PicView/Shortcuts/MainKeyboardShortcuts.cs

@@ -1,10 +1,17 @@
-using PicView.Editing;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Input;
+using PicView.ChangeImage;
+using PicView.ConfigureSettings;
+using PicView.Editing;
 using PicView.Editing.Crop;
+using PicView.FileHandling;
 using PicView.PicGallery;
+using PicView.ProcessHandling;
+using PicView.Properties;
 using PicView.UILogic;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Input;
+using PicView.UILogic.Sizing;
+using PicView.Views.UserControls;
 using static PicView.ChangeImage.ErrorHandling;
 using static PicView.ChangeImage.Navigation;
 using static PicView.FileHandling.Copy_Paste;
@@ -120,7 +127,7 @@ namespace PicView.Shortcuts
                             return;
                         }
                     }
-                    if (Properties.Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
+                    if (Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
                     {
                         GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset - 30);
                     }
@@ -140,7 +147,7 @@ namespace PicView.Shortcuts
 
                 case Key.Up:
                 case Key.W:
-                    if (Properties.Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
+                    if (Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
                     {
                         GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset - 30);
                     }
@@ -155,7 +162,7 @@ namespace PicView.Shortcuts
                     return;
 
                 case Key.Down:
-                    if (Properties.Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
+                    if (Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
                     {
                         GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset + 30);
                     }
@@ -187,7 +194,7 @@ namespace PicView.Shortcuts
                         GalleryNavigation.HorizontalNavigation(GalleryNavigation.Direction.Down);
                         return;
                     }
-                    if (Properties.Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
+                    if (Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible)
                     {
                         GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset + 30);
                     }
@@ -213,8 +220,6 @@ namespace PicView.Shortcuts
                         Zoom(false);
                     }
                     return;
-
-                default: break;
             }
 
             #endregion Keys where it can be held down
@@ -263,9 +268,9 @@ namespace PicView.Shortcuts
                         {
                             GetSettingsWindow.Hide();
                         }
-                        else if (Properties.Settings.Default.Fullscreen)
+                        else if (Settings.Default.Fullscreen)
                         {
-                            UILogic.Sizing.WindowSizing.Fullscreen_Restore();
+                            WindowSizing.Fullscreen_Restore();
                         }
                         else if (GetQuickResize is not null && GetQuickResize.Opacity > 0)
                         {
@@ -285,7 +290,7 @@ namespace PicView.Shortcuts
                     case Key.B:
                         if (!GalleryFunctions.IsHorizontalOpen)
                         {
-                            ConfigureSettings.ConfigColors.ChangeBackground();
+                            ConfigColors.ChangeBackground();
                         }
                         break;
 
@@ -312,7 +317,7 @@ namespace PicView.Shortcuts
                             }
                             else
                             {
-                                ConfigureSettings.UpdateUIValues.SetScrolling();
+                                UpdateUIValues.SetScrolling();
                             }
                         }
                         break;
@@ -328,7 +333,7 @@ namespace PicView.Shortcuts
                     case Key.J:
                         if (!GalleryFunctions.IsHorizontalOpen)
                         {
-                            Views.UserControls.ResizeButton.ToggleQuickResize();
+                            ResizeButton.ToggleQuickResize();
                         }
                         break;
 
@@ -376,11 +381,11 @@ namespace PicView.Shortcuts
                         {
                             if (altDown)
                             {
-                                Views.UserControls.ResizeButton.ToggleQuickResize();
+                                ResizeButton.ToggleQuickResize();
                             }
                             else
                             {
-                                FileHandling.FileFunctions.ShowFileProperties();
+                                FileFunctions.ShowFileProperties();
                             }
                         }
                         else
@@ -411,7 +416,7 @@ namespace PicView.Shortcuts
 
                     // L
                     case Key.L:
-                        ConfigureSettings.UpdateUIValues.SetLooping();
+                        UpdateUIValues.SetLooping();
                         break;
 
                     // E
@@ -431,14 +436,14 @@ namespace PicView.Shortcuts
 
                     // T
                     case Key.T:
-                        ConfigureSettings.UpdateUIValues.SetTopMost();
+                        UpdateUIValues.SetTopMost();
                         break;
 
                     // N
                     case Key.N:
                         if (ctrlDown)
                         {
-                            ProcessHandling.ProcessLogic.StartNewProcess();
+                            ProcessLogic.StartNewProcess();
                         }
                         else
                         {
@@ -468,43 +473,43 @@ namespace PicView.Shortcuts
                                 return;
                             }
                         }
-                        UILogic.Sizing.WindowSizing.CenterWindowOnScreen();
+                        WindowSizing.CenterWindowOnScreen();
                         break;
 
                     // 1
                     case Key.D1:
                         if (QuickSettingsMenuOpen || GalleryFunctions.IsHorizontalOpen
-                        || Properties.Settings.Default.Fullscreen) { break; }
+                        || Settings.Default.Fullscreen) { break; }
 
                         Tooltip.ShowTooltipMessage(Application.Current.Resources["AutoFitWindowMessage"]);
-                        await ConfigureSettings.UpdateUIValues.SetScalingBehaviourAsync(true, false).ConfigureAwait(false);
+                        await UpdateUIValues.SetScalingBehaviourAsync(true, false).ConfigureAwait(false);
                         break;
 
                     // 2
                     case Key.D2:
                         if (QuickSettingsMenuOpen || GalleryFunctions.IsHorizontalOpen
-                        || Properties.Settings.Default.Fullscreen) { break; }
+                        || Settings.Default.Fullscreen) { break; }
 
                         Tooltip.ShowTooltipMessage(Application.Current.Resources["AutoFitWindowFillHeight"]);
-                        await ConfigureSettings.UpdateUIValues.SetScalingBehaviourAsync(true, true).ConfigureAwait(false);
+                        await UpdateUIValues.SetScalingBehaviourAsync(true, true).ConfigureAwait(false);
                         break;
 
                     // 3
                     case Key.D3:
                         if (QuickSettingsMenuOpen || GalleryFunctions.IsHorizontalOpen
-                        || Properties.Settings.Default.Fullscreen) { break; }
+                        || Settings.Default.Fullscreen) { break; }
 
                         Tooltip.ShowTooltipMessage(Application.Current.Resources["NormalWindowBehavior"]);
-                        await ConfigureSettings.UpdateUIValues.SetScalingBehaviourAsync(false, false).ConfigureAwait(false);
+                        await UpdateUIValues.SetScalingBehaviourAsync(false, false).ConfigureAwait(false);
                         break;
 
                     // 4
                     case Key.D4:
                         if (QuickSettingsMenuOpen || GalleryFunctions.IsHorizontalOpen
-                        || Properties.Settings.Default.Fullscreen) { break; }
+                        || Settings.Default.Fullscreen) { break; }
 
                         Tooltip.ShowTooltipMessage(Application.Current.Resources["NormalWindowBehaviorFillHeight"]);
-                        await ConfigureSettings.UpdateUIValues.SetScalingBehaviourAsync(false, true).ConfigureAwait(false);
+                        await UpdateUIValues.SetScalingBehaviourAsync(false, true).ConfigureAwait(false);
                         break;
 
                     // F1
@@ -552,7 +557,7 @@ namespace PicView.Shortcuts
 
                     // F11
                     case Key.F11:
-                        UILogic.Sizing.WindowSizing.Fullscreen_Restore();
+                        WindowSizing.Fullscreen_Restore();
                         break;
 
                     // Home
@@ -572,9 +577,6 @@ namespace PicView.Shortcuts
                             await GalleryClick.ClickAsync(GalleryNavigation.SelectedGalleryItem).ConfigureAwait(false);
                         }
                         break;
-
-
-                    default: break;
                 }
             }
 
@@ -597,9 +599,9 @@ namespace PicView.Shortcuts
                 }
                 else if (e.SystemKey == Key.Enter) // Doesn't work..
                 {
-                    if (Properties.Settings.Default.FullscreenGalleryHorizontal == false)
+                    if (Settings.Default.FullscreenGalleryHorizontal == false)
                     {
-                        UILogic.Sizing.WindowSizing.Fullscreen_Restore();
+                        WindowSizing.Fullscreen_Restore();
                     }
                 }
                 return;
@@ -615,10 +617,8 @@ namespace PicView.Shortcuts
                     {
                         return;
                     }
-                    _ = ChangeImage.FastPic.FastPicUpdateAsync().ConfigureAwait(false);
+                    _ = FastPic.FastPicUpdateAsync().ConfigureAwait(false);
                     return;
-
-                default: break;
             }
         }
     }

+ 19 - 19
PicView/Shortcuts/MainMouseKeys.cs

@@ -1,9 +1,13 @@
-using PicView.Editing;
-using PicView.PicGallery;
-using PicView.UILogic;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Input;
+using PicView.ChangeImage;
+using PicView.Editing;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.UILogic.DragAndDrop;
+using PicView.UILogic.Sizing;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.ConfigureWindows;
 using static PicView.UILogic.TransformImage.Scroll;
@@ -32,7 +36,7 @@ namespace PicView.Shortcuts
             // Move window when Shift is being held down
             if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
             {
-                UILogic.Sizing.WindowSizing.Move(sender, e);
+                WindowSizing.Move(sender, e);
                 return;
             }
 
@@ -54,7 +58,7 @@ namespace PicView.Shortcuts
                 return;
             }
             // Drag logic
-            if (Properties.Settings.Default.ScrollEnabled == false && GetMainWindow.MainImage.IsMouseDirectlyOver) // Only send it when mouse over to not disturb other mouse events
+            if (Settings.Default.ScrollEnabled == false && GetMainWindow.MainImage.IsMouseDirectlyOver) // Only send it when mouse over to not disturb other mouse events
             {
                 PreparePanImage(sender, e);
             }
@@ -73,19 +77,17 @@ namespace PicView.Shortcuts
                     else if (IsAutoScrolling)
                     {
                         StopAutoScroll();
-                        return;
                     }
                     break;
 
                 case MouseButton.Left:
                     if (Keyboard.Modifiers == ModifierKeys.Control)
                     {
-                        UILogic.DragAndDrop.DragToExplorer.DragFile(sender, e);
+                        DragToExplorer.DragFile(sender, e);
                     }
                     if (IsAutoScrolling)
                     {
                         StopAutoScroll();
-                        return;
                     }
                     break;
 
@@ -102,14 +104,12 @@ namespace PicView.Shortcuts
                     break;
 
                 case MouseButton.XButton1:
-                    await ChangeImage.History.PrevAsync().ConfigureAwait(false);
+                    await History.PrevAsync().ConfigureAwait(false);
                     break;
 
                 case MouseButton.XButton2:
-                    await ChangeImage.History.NextAsync().ConfigureAwait(false);
+                    await History.NextAsync().ConfigureAwait(false);
                     break;
-
-                default: break;
             }
         }
 
@@ -192,12 +192,12 @@ namespace PicView.Shortcuts
             }
 
             // Determine horizontal scrolling direction
-            bool dir = Properties.Settings.Default.HorizontalReverseScroll ? e.Delta < 0 : e.Delta > 0;
+            bool dir = Settings.Default.HorizontalReverseScroll ? e.Delta < 0 : e.Delta > 0;
 
             // 1. Handle horizontal gallery
             if (GalleryFunctions.IsHorizontalOpen)
             {
-                if (Properties.Settings.Default.FullscreenGalleryHorizontal && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
+                if (Settings.Default.FullscreenGalleryHorizontal && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
                 {
                     await NavigateToPicAsync(dir).ConfigureAwait(false);
                 }
@@ -210,8 +210,8 @@ namespace PicView.Shortcuts
             }
 
             // 2. Handle scroll enabled and shift not held down
-            if (Properties.Settings.Default.ScrollEnabled && ConfigureWindows.GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible
-                && (Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift)
+            if (Settings.Default.ScrollEnabled && GetMainWindow.Scroller.ComputedVerticalScrollBarVisibility == Visibility.Visible
+                                               && (Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift)
             {
                 var zoomSpeed = 40;
 
@@ -229,7 +229,7 @@ namespace PicView.Shortcuts
 
             if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
             {
-                if (Properties.Settings.Default.CtrlZoom)
+                if (Settings.Default.CtrlZoom)
                 {
                     Zoom(e.Delta > 0);
                 }
@@ -240,7 +240,7 @@ namespace PicView.Shortcuts
             }
             else
             {
-                if (Properties.Settings.Default.CtrlZoom)
+                if (Settings.Default.CtrlZoom)
                 {
                     await NavigateToPicAsync(dir).ConfigureAwait(false);
                 }

+ 11 - 9
PicView/Shortcuts/QuickResizeShortcuts.cs

@@ -1,12 +1,14 @@
-using PicView.ImageHandling;
-using PicView.UILogic;
-using System;
+using System;
 using System.Globalization;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
+using ImageMagick;
+using PicView.ChangeImage;
+using PicView.ImageHandling;
+using PicView.UILogic;
 
 namespace PicView.Shortcuts
 {
@@ -138,13 +140,13 @@ namespace PicView.Shortcuts
 
         private static async Task<bool> FireResizeAsync(string widthText, string heightText)
         {
-            var file = ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex];
+            var file = Navigation.Pics[Navigation.FolderIndex];
             if (int.TryParse(widthText, out var width) && int.TryParse(heightText, out var height))
             {
                 var resize = await ImageSizeFunctions.ResizeImageAsync(file, width, height, 0).ConfigureAwait(false);
                 if (resize)
                 {
-                    await ChangeImage.ErrorHandling.ReloadAsync().ConfigureAwait(false);
+                    await ErrorHandling.ReloadAsync().ConfigureAwait(false);
                 }
                 else
                 {
@@ -156,13 +158,13 @@ namespace PicView.Shortcuts
                 var tryWidth = await FirePercentageAsync(widthText, file).ConfigureAwait(false);
                 if (tryWidth)
                 {
-                    await ChangeImage.ErrorHandling.ReloadAsync().ConfigureAwait(false);
+                    await ErrorHandling.ReloadAsync().ConfigureAwait(false);
                     return false;
                 }
                 var tryHeight = await FirePercentageAsync(heightText, file).ConfigureAwait(false);
                 if (tryHeight)
                 {
-                    await ChangeImage.ErrorHandling.ReloadAsync().ConfigureAwait(false);
+                    await ErrorHandling.ReloadAsync().ConfigureAwait(false);
                 }
                 else
                 {
@@ -177,10 +179,10 @@ namespace PicView.Shortcuts
             var percentage = ReturnPercentageFromString(text);
             if (!(percentage > 0)) { return false; }
             
-            var resize = await ImageSizeFunctions.ResizeImageAsync(file, 0, 0, 0, new ImageMagick.Percentage(percentage)).ConfigureAwait(false);
+            var resize = await ImageSizeFunctions.ResizeImageAsync(file, 0, 0, 0, new Percentage(percentage)).ConfigureAwait(false);
             if (resize)
             {
-                await ChangeImage.ErrorHandling.ReloadAsync().ConfigureAwait(false);
+                await ErrorHandling.ReloadAsync().ConfigureAwait(false);
             }
             return true;
         }

+ 3 - 1
PicView/SystemIntegration/MonitorSize.cs

@@ -1,5 +1,7 @@
 using System;
 using System.Windows;
+using System.Windows.Interop;
+using WpfScreenHelper;
 
 namespace PicView.SystemIntegration
 {
@@ -61,7 +63,7 @@ namespace PicView.SystemIntegration
         internal static MonitorSize GetMonitorSize()
         {
             // https://stackoverflow.com/a/32599760
-            var currentMonitor = WpfScreenHelper.Screen.FromHandle(new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle);
+            var currentMonitor = Screen.FromHandle(new WindowInteropHelper(Application.Current.MainWindow).Handle);
 
             //find out if the app is being scaled by the monitor
             var source = PresentationSource.FromVisual(Application.Current.MainWindow);

+ 12 - 10
PicView/SystemIntegration/NativeMethods.cs

@@ -1,13 +1,15 @@
-using Microsoft.Win32;
-using PicView.PicGallery;
-using PicView.UILogic;
-using PicView.UILogic.Sizing;
-using System;
+using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Runtime.InteropServices;
 using System.Security;
 using System.Windows;
 using System.Windows.Interop;
+using Microsoft.Win32;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
 
 namespace PicView.SystemIntegration
 {
@@ -147,14 +149,14 @@ namespace PicView.SystemIntegration
         /// Executes when user manually resized window
         public static IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
         {
-            if (Properties.Settings.Default.AutoFitWindow || GalleryFunctions.IsVerticalFullscreenOpen || GalleryFunctions.IsHorizontalFullscreenOpen)
+            if (Settings.Default.AutoFitWindow || GalleryFunctions.IsVerticalFullscreenOpen || GalleryFunctions.IsHorizontalFullscreenOpen)
             {
                 return IntPtr.Zero;
             }
 
             if (msg == WM_SIZING || msg == 0x0005)
             {
-                var w = UILogic.ConfigureWindows.GetMainWindow;
+                var w = ConfigureWindows.GetMainWindow;
                 if (w == null) { return IntPtr.Zero; }
 
                 if (w.MainImage.Source == null)
@@ -168,7 +170,7 @@ namespace PicView.SystemIntegration
                 {
                     if (w.WindowState == WindowState.Maximized)
                     {
-                        UILogic.Sizing.WindowSizing.Restore_From_Move();
+                        WindowSizing.Restore_From_Move();
                     }
                     if (w.MainImage.Source == null) { return IntPtr.Zero; }
 
@@ -333,13 +335,13 @@ namespace PicView.SystemIntegration
         [DllImport("user32.dll", SetLastError = true)]
         public static extern int ReleaseDC(IntPtr window, IntPtr dc);
 
-        public static System.Drawing.Color GetColorAt(int x, int y)
+        public static Color GetColorAt(int x, int y)
         {
             IntPtr desk = GetDesktopWindow();
             IntPtr dc = GetWindowDC(desk);
             int a = (int)GetPixel(dc, x, y);
             _ = ReleaseDC(desk, dc);
-            return System.Drawing.Color.FromArgb(255, (a >> 0) & 0xff, (a >> 8) & 0xff, (a >> 16) & 0xff);
+            return Color.FromArgb(255, (a >> 0) & 0xff, (a >> 8) & 0xff, (a >> 16) & 0xff);
         }
 
         #endregion GetPixelColor

+ 9 - 7
PicView/SystemIntegration/Taskbar.cs

@@ -1,7 +1,9 @@
 
 
-using PicView.UILogic;
 using System.Threading.Tasks;
+using System.Windows.Shell;
+using System.Windows.Threading;
+using PicView.UILogic;
 
 namespace PicView.SystemIntegration
 {
@@ -16,13 +18,13 @@ namespace PicView.SystemIntegration
         /// <param name="ii">size</param>
         internal static async Task Progress(double d)
         {
-            System.Windows.Shell.TaskbarItemInfo taskbar = new()
+            TaskbarItemInfo taskbar = new()
             {
-                ProgressState = System.Windows.Shell.TaskbarItemProgressState.Normal,
+                ProgressState = TaskbarItemProgressState.Normal,
                 ProgressValue = d
             };
             taskbar.Freeze();
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 ConfigureWindows.GetMainWindow.TaskbarItemInfo = taskbar;
             });
@@ -33,13 +35,13 @@ namespace PicView.SystemIntegration
         /// </summary>
         internal static async Task NoProgress()
         {
-            System.Windows.Shell.TaskbarItemInfo taskbar = new()
+            TaskbarItemInfo taskbar = new()
             {
-                ProgressState = System.Windows.Shell.TaskbarItemProgressState.Normal,
+                ProgressState = TaskbarItemProgressState.Normal,
                 ProgressValue = 0.0
             };
             taskbar.Freeze();
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 ConfigureWindows.GetMainWindow.TaskbarItemInfo = taskbar;
             });

+ 9 - 10
PicView/SystemIntegration/Wallpaper.cs

@@ -1,15 +1,14 @@
-using Microsoft.Win32;
-using PicView.FileHandling;
-using PicView.ImageHandling;
-using PicView.UILogic;
-using System;
+using System;
 using System.ComponentModel;
 using System.Globalization;
 using System.IO;
 using System.Threading.Tasks;
-using System.Timers;
-using System.Windows;
 using System.Windows.Media.Imaging;
+using System.Windows.Threading;
+using Microsoft.Win32;
+using PicView.ChangeImage;
+using PicView.ImageHandling;
+using PicView.UILogic;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.TransformImage.Rotation;
 
@@ -40,14 +39,14 @@ namespace PicView.SystemIntegration
             var source = ConfigureWindows.GetMainWindow.MainImage.Source as BitmapSource;
             var effectApplied = ConfigureWindows.GetMainWindow.MainImage.Effect != null;
 
-            if (effectApplied || ChangeImage.ErrorHandling.CheckOutOfRange())
+            if (effectApplied || ErrorHandling.CheckOutOfRange())
             {
-                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, async () =>
+                await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, async () =>
                 {
                     await SaveImages.SaveImageAsync(Rotateint, Flipped, source, null, destination, null, effectApplied).ConfigureAwait(false);
                 });
             }
-            else if (ChangeImage.ErrorHandling.CheckOutOfRange() == false)
+            else if (ErrorHandling.CheckOutOfRange() == false)
             {
                 await SaveImages.SaveImageAsync(Rotateint, Flipped, null, Pics[FolderIndex], destination, null, effectApplied).ConfigureAwait(false);
             }

+ 3 - 2
PicView/Themes/Resources/DrawingBrushes.cs

@@ -1,5 +1,6 @@
 using System.Windows;
 using System.Windows.Media;
+using PicView.ConfigureSettings;
 
 namespace PicView.Library.Resources
 {
@@ -9,7 +10,7 @@ namespace PicView.Library.Resources
 
         public static DrawingBrush CheckerboardDrawingBrush(Color color)
         {
-            return CheckerboardDrawingBrush(color, ConfigureSettings.ConfigColors.BackgroundBorderColor, 30);
+            return CheckerboardDrawingBrush(color, ConfigColors.BackgroundBorderColor, 30);
         }
 
         public static DrawingBrush CheckerboardDrawingBrush(Color color, Color color2, int size)
@@ -24,7 +25,7 @@ namespace PicView.Library.Resources
 
             var drawingroup = new DrawingGroup();
 
-            var geoBlack = new GeometryDrawing()
+            var geoBlack = new GeometryDrawing
             {
                 Brush = new SolidColorBrush(color)
             };

+ 5 - 4
PicView/Translations/LoadLanguage.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Globalization;
 using System.Windows;
+using PicView.Properties;
 
 namespace PicView.Translations
 {
@@ -8,11 +9,11 @@ namespace PicView.Translations
     {
         internal static void DetermineLanguage()
         {
-            if (Properties.Settings.Default.UserLanguage != "en")
+            if (Settings.Default.UserLanguage != "en")
             {
                 Application.Current.Resources.MergedDictionaries[0] = new ResourceDictionary
                 {
-                    Source = new Uri(@"/PicView;component/Translations/" + Properties.Settings.Default.UserLanguage + ".xaml", UriKind.Relative)
+                    Source = new Uri(@"/PicView;component/Translations/" + Settings.Default.UserLanguage + ".xaml", UriKind.Relative)
                 };
                 return;
             }
@@ -83,9 +84,9 @@ namespace PicView.Translations
         internal static void ChangeLanguage(int language)
         {
             var choice = (Languages)language;
-            Properties.Settings.Default.UserLanguage = choice.ToString();
+            Settings.Default.UserLanguage = choice.ToString();
 
-            Properties.Settings.Default.Save();
+            Settings.Default.Save();
         }
     }
 }

+ 12 - 10
PicView/UILogic/ConfigureWindows.cs

@@ -1,5 +1,7 @@
-using PicView.Views.Windows;
-using System.Windows;
+using System.Windows;
+using System.Windows.Controls;
+using PicView.Properties;
+using PicView.Views.Windows;
 
 namespace PicView.UILogic
 {
@@ -19,14 +21,14 @@ namespace PicView.UILogic
         /// <summary>
         /// Primary ContextMenu
         /// </summary>
-        internal static System.Windows.Controls.ContextMenu? MainContextMenu { get; set; }
+        internal static ContextMenu? MainContextMenu { get; set; }
 
         internal static bool IsMainWindowTopMost
         {
-            get { return Properties.Settings.Default.TopMost; }
+            get { return Settings.Default.TopMost; }
             set
             {
-                Properties.Settings.Default.TopMost = value;
+                Settings.Default.TopMost = value;
                 GetMainWindow.Topmost = value;
             }
         }
@@ -54,7 +56,7 @@ namespace PicView.UILogic
                     GetInfoWindow.Show();
                 }
             }
-            if (Properties.Settings.Default.Fullscreen)
+            if (Settings.Default.Fullscreen)
             {
                 GetInfoWindow.Topmost = true;
                 GetInfoWindow.BringIntoView();
@@ -87,7 +89,7 @@ namespace PicView.UILogic
                     GetSettingsWindow.Show();
                 }
             }
-            if (Properties.Settings.Default.Fullscreen)
+            if (Settings.Default.Fullscreen)
             {
                 GetSettingsWindow.Topmost = true;
                 GetSettingsWindow.BringIntoView();
@@ -120,7 +122,7 @@ namespace PicView.UILogic
                     GetEffectsWindow.Show();
                 }
             }
-            if (Properties.Settings.Default.Fullscreen)
+            if (Settings.Default.Fullscreen)
             {
                 GetEffectsWindow.Topmost = true;
                 GetEffectsWindow.BringIntoView();
@@ -153,7 +155,7 @@ namespace PicView.UILogic
                     GetImageInfoWindow.Show();
                 }
             }
-            if (Properties.Settings.Default.Fullscreen)
+            if (Settings.Default.Fullscreen)
             {
                 GetImageInfoWindow.Topmost = true;
                 GetImageInfoWindow.BringIntoView();
@@ -183,7 +185,7 @@ namespace PicView.UILogic
                     GetResizeWindow.Show();
                 }
             }
-            if (Properties.Settings.Default.Fullscreen)
+            if (Settings.Default.Fullscreen)
             {
                 GetResizeWindow.Topmost = true;
                 GetResizeWindow.BringIntoView();

+ 8 - 6
PicView/UILogic/DragAndDrop/DragToExplorer.cs

@@ -1,9 +1,11 @@
-using PicView.FileHandling;
-using PicView.UILogic.TransformImage;
-using System;
+using System;
 using System.Collections.Specialized;
 using System.Windows;
 using System.Windows.Input;
+using PicView.FileHandling;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.UILogic.TransformImage;
 using static PicView.ChangeImage.Navigation;
 
 namespace PicView.UILogic.DragAndDrop
@@ -16,8 +18,8 @@ namespace PicView.UILogic.DragAndDrop
                 || Keyboard.Modifiers != ModifierKeys.Control
                 || Keyboard.Modifiers == ModifierKeys.Shift
                 || Keyboard.Modifiers == ModifierKeys.Alt
-                || PicGallery.GalleryFunctions.IsHorizontalOpen
-                || Properties.Settings.Default.Fullscreen
+                || GalleryFunctions.IsHorizontalOpen
+                || Settings.Default.Fullscreen
                 || Scroll.IsAutoScrolling
                 || ZoomLogic.IsZoomed)
             {
@@ -66,7 +68,7 @@ namespace PicView.UILogic.DragAndDrop
 
             FrameworkElement? senderElement = sender as FrameworkElement;
             DataObject dragObj = new DataObject();
-            dragObj.SetFileDropList(new StringCollection() { file });
+            dragObj.SetFileDropList(new StringCollection { file });
             DragDrop.DoDragDrop(senderElement, dragObj, DragDropEffects.Copy);
 
             e.Handled = true;

+ 13 - 10
PicView/UILogic/DragAndDrop/Image_DragAndDrop.cs

@@ -1,12 +1,15 @@
-using PicView.ChangeImage;
+using System.IO;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+using PicView.ChangeImage;
 using PicView.FileHandling;
+using PicView.PicGallery;
 using PicView.ProcessHandling;
+using PicView.Properties;
 using PicView.Views.UserControls;
 using PicView.Views.UserControls.Misc;
-using System.IO;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
 using static PicView.ChangeImage.Navigation;
 using static PicView.ImageHandling.Thumbnails;
 using static PicView.UILogic.Tooltip;
@@ -27,7 +30,7 @@ namespace PicView.UILogic.DragAndDrop
         /// <param name="e"></param>
         internal static void Image_DragEnter(object sender, DragEventArgs e)
         {
-            if (PicGallery.GalleryFunctions.IsHorizontalOpen)
+            if (GalleryFunctions.IsHorizontalOpen)
             {
                 return;
             }
@@ -50,7 +53,7 @@ namespace PicView.UILogic.DragAndDrop
             }
             else if (Directory.Exists(files[0]))
             {
-                if (Properties.Settings.Default.IncludeSubDirectories || Directory.GetFiles(files[0]).Length > 0)
+                if (Settings.Default.IncludeSubDirectories || Directory.GetFiles(files[0]).Length > 0)
                 {
                     // Folder
                     element = new FolderIcon();
@@ -124,12 +127,12 @@ namespace PicView.UILogic.DragAndDrop
         /// <param name="e"></param>
         internal static async Task Image_Drop(object sender, DragEventArgs e)
         {
-            if (PicGallery.GalleryFunctions.IsHorizontalOpen)
+            if (GalleryFunctions.IsHorizontalOpen)
             {
                 return;
             }
 
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 RemoveDragOverlay();
             });
@@ -180,7 +183,7 @@ namespace PicView.UILogic.DragAndDrop
 
             await LoadPic.LoadPicFromStringAsync(files[0]).ConfigureAwait(false);
 
-            ConfigureWindows.GetMainWindow.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            ConfigureWindows.GetMainWindow.Dispatcher.Invoke(DispatcherPriority.Background, () =>
             {
                 // Don't show drop message any longer
                 CloseToolTipMessage();

+ 11 - 8
PicView/UILogic/HideInterfaceLogic.cs

@@ -1,6 +1,9 @@
-using PicView.PicGallery;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
+using System.Timers;
 using System.Windows;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.UILogic.Sizing;
 using static PicView.Animations.FadeControls;
 
 namespace PicView.UILogic
@@ -13,12 +16,12 @@ namespace PicView.UILogic
         internal static void ToggleInterface()
         {
             if (GalleryFunctions.IsVerticalFullscreenOpen || GalleryFunctions.IsHorizontalFullscreenOpen
-                || Properties.Settings.Default.Fullscreen)
+                || Settings.Default.Fullscreen)
             {
                 return;
             }
 
-            if (Properties.Settings.Default.ShowInterface)
+            if (Settings.Default.ShowInterface)
             {
                 if (ConfigureWindows.GetMainWindow.TitleBar.Visibility == Visibility.Visible)
                 {
@@ -37,17 +40,17 @@ namespace PicView.UILogic
             UC.Close_UserControls();
 
             // Recalculate to new size
-            var timer = new System.Timers.Timer(50) // If not fired in timer, calculation incorrect 
+            var timer = new Timer(50) // If not fired in timer, calculation incorrect 
             {
                 AutoReset = false,
                 Enabled = true,
             };
-            timer.Elapsed += (_, _) => _ = Sizing.ScaleImage.TryFitImageAsync().ConfigureAwait(true);
+            timer.Elapsed += (_, _) => _ = ScaleImage.TryFitImageAsync().ConfigureAwait(true);
         }
 
         internal static void ShowStandardInterface()
         {
-            Properties.Settings.Default.ShowInterface = true;
+            Settings.Default.ShowInterface = true;
 
             ShowTopandBottom(true);
             ShowNavigation(false);
@@ -65,7 +68,7 @@ namespace PicView.UILogic
             ShowNavigation(true);
             ShowShortcuts(true);
 
-            Properties.Settings.Default.ShowInterface = false;
+            Settings.Default.ShowInterface = false;
 
             if (ActivityTimer != null)
             {

+ 9 - 8
PicView/UILogic/ImageInfo.cs

@@ -1,13 +1,14 @@
-using PicView.FileHandling;
-using PicView.ImageHandling;
-using PicView.Views.UserControls;
-using System;
+using System;
 using System.IO;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.FileHandling;
+using PicView.ImageHandling;
+using PicView.Views.UserControls;
 
 namespace PicView.UILogic
 {
@@ -17,7 +18,7 @@ namespace PicView.UILogic
 
         internal static async Task RenameTask(KeyEventArgs e, TextBox textBox, string file)
         {
-            if (e.Key != System.Windows.Input.Key.Enter) { return; }
+            if (e.Key != Key.Enter) { return; }
 
             e.Handled = true;
             var rename = await FileFunctions.RenameFileWithErrorChecking(file).ConfigureAwait(false);
@@ -39,9 +40,9 @@ namespace PicView.UILogic
         {
             if (fileInfo is null)
             {
-                if (ChangeImage.Navigation.Pics.Count > 0 && ChangeImage.Navigation.Pics.Count > ChangeImage.Navigation.FolderIndex)
+                if (Navigation.Pics.Count > 0 && Navigation.Pics.Count > Navigation.FolderIndex)
                 {
-                    fileInfo = new FileInfo(ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex]);
+                    fileInfo = new FileInfo(Navigation.Pics[Navigation.FolderIndex]);
                 }
             }
 
@@ -67,7 +68,7 @@ namespace PicView.UILogic
 
             await ConfigureWindows.GetImageInfoWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
             {
-                if (fileInfo is not null && ChangeImage.Navigation.Pics[ChangeImage.Navigation.FolderIndex] != fileInfo.FullName)
+                if (fileInfo is not null && Navigation.Pics[Navigation.FolderIndex] != fileInfo.FullName)
                 {
                     return;
                 }

+ 40 - 34
PicView/UILogic/Loading/LoadContextMenus.cs

@@ -1,7 +1,13 @@
-using PicView.ConfigureSettings;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
+using PicView.ChangeImage;
+using PicView.ConfigureSettings;
+using PicView.FileHandling;
+using PicView.ImageHandling;
+using PicView.Properties;
+using PicView.SystemIntegration;
+using PicView.Views.UserControls;
 using static PicView.ChangeImage.Navigation;
 using static PicView.FileHandling.Open_Save;
 using static PicView.UILogic.ConfigureWindows;
@@ -13,9 +19,9 @@ namespace PicView.UILogic.Loading
         internal static void AddContextMenus()
         {
             // Add main contextmenu
-            ConfigureWindows.MainContextMenu = (ContextMenu)Application.Current.Resources["mainCM"];
-            ConfigureWindows.GetMainWindow.ParentContainer.ContextMenu = ConfigureWindows.MainContextMenu;
-            ConfigureWindows.MainContextMenu.Opened += (_, _) => ChangeImage.History.RefreshRecentItemsMenu();
+            MainContextMenu = (ContextMenu)Application.Current.Resources["mainCM"];
+            GetMainWindow.ParentContainer.ContextMenu = MainContextMenu;
+            MainContextMenu.Opened += (_, _) => History.RefreshRecentItemsMenu();
 
             ///////////////////////////
             ///     Open           \\\\
@@ -51,43 +57,43 @@ namespace PicView.UILogic.Loading
             // FileName
             var FileNameMenu = (MenuItem)sortfilesbycm.Items[0];
             var FileNameHeader = (RadioButton)FileNameMenu.Header;
-            FileNameHeader.IsChecked = Properties.Settings.Default.SortPreference == 0;
+            FileNameHeader.IsChecked = Settings.Default.SortPreference == 0;
             FileNameHeader.Click += async delegate { MainContextMenu.IsOpen = false; await UpdateUIValues.ChangeSortingAsync(0).ConfigureAwait(false); };
 
             // FileSize
             var filesizeMenu = (MenuItem)sortfilesbycm.Items[1];
             var filesizeHeader = (RadioButton)filesizeMenu.Header;
-            filesizeHeader.IsChecked = Properties.Settings.Default.SortPreference == 1;
+            filesizeHeader.IsChecked = Settings.Default.SortPreference == 1;
             filesizeHeader.Click += async delegate { MainContextMenu.IsOpen = false; await UpdateUIValues.ChangeSortingAsync(1).ConfigureAwait(false); };
 
             // FileExtension
             var FileExtensionMenu = (MenuItem)sortfilesbycm.Items[2];
             var FileExtensionHeader = (RadioButton)FileExtensionMenu.Header;
-            FileExtensionHeader.IsChecked = Properties.Settings.Default.SortPreference == 3;
+            FileExtensionHeader.IsChecked = Settings.Default.SortPreference == 3;
             FileExtensionHeader.Click += async delegate { MainContextMenu.IsOpen = false; await UpdateUIValues.ChangeSortingAsync(3).ConfigureAwait(false); };
 
             // CreationTime
             var CreationTimeMenu = (MenuItem)sortfilesbycm.Items[3];
             var CreationTimeHeader = (RadioButton)CreationTimeMenu.Header;
-            CreationTimeHeader.IsChecked = Properties.Settings.Default.SortPreference == 2;
+            CreationTimeHeader.IsChecked = Settings.Default.SortPreference == 2;
             CreationTimeHeader.Click += async delegate { MainContextMenu.IsOpen = false; await UpdateUIValues.ChangeSortingAsync(2).ConfigureAwait(false); };
 
             // LastAccessTime
             var LastAccessTimeMenu = (MenuItem)sortfilesbycm.Items[4];
             var LastAccessTimeHeader = (RadioButton)LastAccessTimeMenu.Header;
-            LastAccessTimeHeader.IsChecked = Properties.Settings.Default.SortPreference == 4;
+            LastAccessTimeHeader.IsChecked = Settings.Default.SortPreference == 4;
             LastAccessTimeHeader.Click += async delegate { MainContextMenu.IsOpen = false; await UpdateUIValues.ChangeSortingAsync(4).ConfigureAwait(false); };
 
             // LastWriteTime
             var LastWriteTimeMenu = (MenuItem)sortfilesbycm.Items[5];
             var LastWriteTimeHeader = (RadioButton)LastWriteTimeMenu.Header;
-            LastWriteTimeHeader.IsChecked = Properties.Settings.Default.SortPreference == 5;
+            LastWriteTimeHeader.IsChecked = Settings.Default.SortPreference == 5;
             LastWriteTimeHeader.Click += async delegate { MainContextMenu.IsOpen = false; await UpdateUIValues.ChangeSortingAsync(5).ConfigureAwait(false); };
 
             // Random
             var RandomMenu = (MenuItem)sortfilesbycm.Items[6];
             var RandomHeader = (RadioButton)RandomMenu.Header;
-            RandomHeader.IsChecked = Properties.Settings.Default.SortPreference == 6;
+            RandomHeader.IsChecked = Settings.Default.SortPreference == 6;
             RandomHeader.Click += async delegate { MainContextMenu.IsOpen = false; await UpdateUIValues.ChangeSortingAsync(6).ConfigureAwait(false); };
 
             // 7 = seperator
@@ -95,20 +101,20 @@ namespace PicView.UILogic.Loading
             // Ascending
             var AscendingMenu = (MenuItem)sortfilesbycm.Items[8];
             var AscendingHeader = (RadioButton)AscendingMenu.Header;
-            AscendingHeader.IsChecked = Properties.Settings.Default.Ascending;
+            AscendingHeader.IsChecked = Settings.Default.Ascending;
             AscendingHeader.Click += async (_, _) =>
             {
-                Properties.Settings.Default.Ascending = true;
+                Settings.Default.Ascending = true;
                 await UpdateUIValues.ChangeSortingAsync(0, true).ConfigureAwait(false);
             };
 
             // Descending
             var DescendingMenu = (MenuItem)sortfilesbycm.Items[9];
             var DescendingHeader = (RadioButton)DescendingMenu.Header;
-            DescendingHeader.IsChecked = Properties.Settings.Default.Ascending == false;
+            DescendingHeader.IsChecked = Settings.Default.Ascending == false;
             DescendingHeader.Click += async (_, _) =>
             {
-                Properties.Settings.Default.Ascending = false;
+                Settings.Default.Ascending = false;
                 await UpdateUIValues.ChangeSortingAsync(0, true).ConfigureAwait(false);
             };
 
@@ -122,14 +128,14 @@ namespace PicView.UILogic.Loading
             // Looping
             var LoopingMenu = (MenuItem)settingscm.Items[0];
             var LoopingHeader = (CheckBox)LoopingMenu.Header;
-            LoopingHeader.IsChecked = Properties.Settings.Default.Looping;
+            LoopingHeader.IsChecked = Settings.Default.Looping;
             LoopingHeader.Click += (_, _) => UpdateUIValues.SetLooping();
             LoopingMenu.Click += (_, _) => { UpdateUIValues.SetLooping(); LoopingHeader.IsChecked = !LoopingHeader.IsChecked; };
 
             // Scrolling
             var ScrollingMenu = (MenuItem)settingscm.Items[1];
             var ScrollingHeader = (CheckBox)ScrollingMenu.Header;
-            ScrollingHeader.IsChecked = Properties.Settings.Default.ScrollEnabled;
+            ScrollingHeader.IsChecked = Settings.Default.ScrollEnabled;
             ScrollingHeader.Click += (_, _) => UpdateUIValues.SetScrolling();
             ScrollingMenu.Click += (_, _) => { UpdateUIValues.SetScrolling(); ScrollingHeader.IsChecked = !ScrollingHeader.IsChecked; };
 
@@ -137,7 +143,7 @@ namespace PicView.UILogic.Loading
             var ToogleUIMenu = (MenuItem)settingscm.Items[2];
             ToogleUIMenu.InputGestureText = $"{Application.Current.Resources["Alt"]} + Z";
             var ToogleUIHeader = (CheckBox)ToogleUIMenu.Header;
-            ToogleUIHeader.IsChecked = Properties.Settings.Default.ShowInterface;
+            ToogleUIHeader.IsChecked = Settings.Default.ShowInterface;
             ToogleUIHeader.Click += (_, _) => HideInterfaceLogic.ToggleInterface();
             ToogleUIMenu.Click += (_, _) => { HideInterfaceLogic.ToggleInterface(); ToogleUIHeader.IsChecked = !ToogleUIHeader.IsChecked; };
 
@@ -148,7 +154,7 @@ namespace PicView.UILogic.Loading
             // Topmost
             var TopmostMenu = (MenuItem)settingscm.Items[4];
             var TopmostHeader = (CheckBox)TopmostMenu.Header;
-            TopmostHeader.IsChecked = Properties.Settings.Default.TopMost;
+            TopmostHeader.IsChecked = Settings.Default.TopMost;
             TopmostHeader.Click += (_, _) => UpdateUIValues.SetTopMost();
             TopmostMenu.Click += (_, _) => UpdateUIValues.SetTopMost();
 
@@ -167,7 +173,7 @@ namespace PicView.UILogic.Loading
             SetWallpaperCm.Click += async (_, _) =>
             {
                 MainContextMenu.IsOpen = false;
-                await SystemIntegration.Wallpaper.SetWallpaperAsync(SystemIntegration.Wallpaper.WallpaperStyle.Fill).ConfigureAwait(false);
+                await Wallpaper.SetWallpaperAsync(Wallpaper.WallpaperStyle.Fill).ConfigureAwait(false);
             };
 
 
@@ -175,7 +181,7 @@ namespace PicView.UILogic.Loading
             ///   ShowInFolder     \\\\
             ///////////////////////////
             var ShowInFolderCm = (MenuItem)MainContextMenu.Items[10];
-            ShowInFolderCm.Click += (_, _) => FileHandling.Open_Save.Open_In_Explorer();
+            ShowInFolderCm.Click += (_, _) => Open_In_Explorer();
 
 
             ///////////////////////////
@@ -184,19 +190,19 @@ namespace PicView.UILogic.Loading
             var ImageChoices = (MenuItem)MainContextMenu.Items[11];
 
             var ImageInfoCm = (MenuItem)ImageChoices.Items[0];
-            ImageInfoCm.Click += (_, _) => ConfigureWindows.ImageInfoWindow();
+            ImageInfoCm.Click += (_, _) => ImageInfoWindow();
 
             var FileProps = (MenuItem)ImageChoices.Items[1];
-            FileProps.Click += (_, _) => FileHandling.FileFunctions.ShowFileProperties();
+            FileProps.Click += (_, _) => FileFunctions.ShowFileProperties();
             FileProps.InputGestureText = $"{Application.Current.Resources["Ctrl"]} + I";
 
             // 2 = seperator
 
             var ImageSize = (MenuItem)ImageChoices.Items[3];
-            ImageSize.Click += (_, _) => Views.UserControls.ResizeButton.ToggleQuickResize();
+            ImageSize.Click += (_, _) => ResizeButton.ToggleQuickResize();
 
             var BatchSize = (MenuItem)ImageChoices.Items[4];
-            BatchSize.Click += (_, _) => ConfigureWindows.ResizeWindow();
+            BatchSize.Click += (_, _) => ResizeWindow();
 
             // 12 = seperator
 
@@ -208,21 +214,21 @@ namespace PicView.UILogic.Loading
             // Copy file
             var copyFileCm = (MenuItem)CopyCm.Items[0];
             copyFileCm.InputGestureText = $"{Application.Current.Resources["Ctrl"]} + {Application.Current.Resources["Shift"]} + C";
-            copyFileCm.Click += (_, _) => FileHandling.Copy_Paste.Copyfile();
+            copyFileCm.Click += (_, _) => Copy_Paste.Copyfile();
 
             // FileCopyPath
             var FileCopyPathCm = (MenuItem)CopyCm.Items[1];
             FileCopyPathCm.InputGestureText = $"{Application.Current.Resources["Ctrl"]} + {Application.Current.Resources["Alt"]} + C";
-            FileCopyPathCm.Click += (_, _) => FileHandling.Copy_Paste.CopyFilePath();
+            FileCopyPathCm.Click += (_, _) => Copy_Paste.CopyFilePath();
 
             // CopyImage
             var CopyImageCm = (MenuItem)CopyCm.Items[2];
             CopyImageCm.InputGestureText = $"{Application.Current.Resources["Ctrl"]} + C";
-            CopyImageCm.Click += (_, _) => FileHandling.Copy_Paste.CopyBitmap();
+            CopyImageCm.Click += (_, _) => Copy_Paste.CopyBitmap();
 
             // CopyBase64
             var CopyBase64Cm = (MenuItem)CopyCm.Items[3];
-            CopyBase64Cm.Click += async delegate { MainContextMenu.IsOpen = false; await ImageHandling.Base64.SendToClipboard().ConfigureAwait(false); };
+            CopyBase64Cm.Click += async delegate { MainContextMenu.IsOpen = false; await Base64.SendToClipboard().ConfigureAwait(false); };
 
 
             ///////////////////////////
@@ -230,7 +236,7 @@ namespace PicView.UILogic.Loading
             ///////////////////////////
             var Cutcm = (MenuItem)MainContextMenu.Items[14];
             Cutcm.InputGestureText = $"{Application.Current.Resources["Ctrl"]} + X";
-            Cutcm.Click += (_, _) => { MainContextMenu.IsOpen = false; FileHandling.Copy_Paste.Cut(); };
+            Cutcm.Click += (_, _) => { MainContextMenu.IsOpen = false; Copy_Paste.Cut(); };
 
 
             ///////////////////////////
@@ -238,7 +244,7 @@ namespace PicView.UILogic.Loading
             ///////////////////////////
             var pastecm = (MenuItem)MainContextMenu.Items[15];
             pastecm.InputGestureText = $"{Application.Current.Resources["Ctrl"]} + V";
-            pastecm.Click += (_, _) => { MainContextMenu.IsOpen = false; FileHandling.Copy_Paste.Paste(); };
+            pastecm.Click += (_, _) => { MainContextMenu.IsOpen = false; Copy_Paste.Paste(); };
 
             // 16 = seperator
 
@@ -246,7 +252,7 @@ namespace PicView.UILogic.Loading
             ///   Delete File       \\\\
             ///////////////////////////
             var Deletecm = (MenuItem)MainContextMenu.Items[17];
-            Deletecm.Click += async (_, _) => await FileHandling.DeleteFiles.DeleteFileAsync(Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)).ConfigureAwait(false);
+            Deletecm.Click += async (_, _) => await DeleteFiles.DeleteFileAsync(Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)).ConfigureAwait(false);
 
             // 18 = seperator
 
@@ -254,7 +260,7 @@ namespace PicView.UILogic.Loading
             ///   Close       \\\\
             ///////////////////////////
             var CloseCm = (MenuItem)MainContextMenu.Items[19];
-            CloseCm.Click += (_, _) => SystemCommands.CloseWindow(ConfigureWindows.GetMainWindow);
+            CloseCm.Click += (_, _) => SystemCommands.CloseWindow(GetMainWindow);
 
 
         }

+ 11 - 14
PicView/UILogic/Loading/LoadControls.cs

@@ -1,7 +1,8 @@
-using PicView.Views.UserControls;
-using PicView.Views.UserControls.Misc;
-using System.Diagnostics;
+using System.Diagnostics;
 using System.Windows;
+using PicView.Properties;
+using PicView.Views.UserControls;
+using PicView.Views.UserControls.Misc;
 using static PicView.UILogic.UC;
 
 namespace PicView.UILogic.Loading
@@ -51,7 +52,7 @@ namespace PicView.UILogic.Loading
         /// </summary>
         internal static void Loadx2()
         {
-            Getx2 = new X2()
+            Getx2 = new X2
             {
                 Focusable = false,
                 VerticalAlignment = VerticalAlignment.Top,
@@ -72,7 +73,7 @@ namespace PicView.UILogic.Loading
         /// </summary>
         internal static void LoadMinus()
         {
-            GetMinus = new Minus()
+            GetMinus = new Minus
             {
                 Focusable = false,
                 VerticalAlignment = VerticalAlignment.Top,
@@ -93,7 +94,7 @@ namespace PicView.UILogic.Loading
         /// </summary>
         internal static void LoadRestoreButton()
         {
-            GetRestorebutton = new Restorebutton()
+            GetRestorebutton = new Restorebutton
             {
                 Focusable = false,
                 VerticalAlignment = VerticalAlignment.Top,
@@ -114,7 +115,7 @@ namespace PicView.UILogic.Loading
         /// </summary>
         internal static void LoadGalleryShortcut()
         {
-            GetGalleryShortcut = new GalleryShortcut()
+            GetGalleryShortcut = new GalleryShortcut
             {
                 Focusable = false,
                 VerticalAlignment = VerticalAlignment.Bottom,
@@ -188,7 +189,7 @@ namespace PicView.UILogic.Loading
                 Margin = new Thickness(81, 0, 0, 0)
             };
 
-            GetQuickSettingsMenu.SetFit.IsChecked = Properties.Settings.Default.AutoFitWindow;
+            GetQuickSettingsMenu.SetFit.IsChecked = Settings.Default.AutoFitWindow;
 
             ConfigureWindows.GetMainWindow.ParentContainer.Children.Add(GetQuickSettingsMenu);
 
@@ -266,9 +267,7 @@ namespace PicView.UILogic.Loading
         /// </summary>
         internal static void LoadCroppingTool()
         {
-            GetCropppingTool = new CroppingTool
-            {
-            };
+            GetCropppingTool = new CroppingTool();
 
             ConfigureWindows.GetMainWindow.ParentContainer.Children.Add(GetCropppingTool);
 
@@ -282,9 +281,7 @@ namespace PicView.UILogic.Loading
         /// </summary>
         internal static void LoadColorPicker()
         {
-            GetColorPicker = new ColorPicker
-            {
-            };
+            GetColorPicker = new ColorPicker();
 
             ConfigureWindows.GetMainWindow.topLayer.Children.Add(GetColorPicker);
 

+ 19 - 16
PicView/UILogic/Loading/StartLoading.cs

@@ -1,9 +1,12 @@
-using PicView.PicGallery;
-using PicView.SystemIntegration;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Windows;
 using System.Windows.Controls;
+using PicView.ChangeImage;
+using PicView.ConfigureSettings;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.SystemIntegration;
 using static PicView.ChangeImage.ErrorHandling;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.Loading.LoadContextMenus;
@@ -28,18 +31,18 @@ namespace PicView.UILogic.Loading
             ConfigureWindows.GetMainWindow.MinWidth *= MonitorInfo.DpiScaling;
             ConfigureWindows.GetMainWindow.MinHeight *= MonitorInfo.DpiScaling;
 
-            if (Properties.Settings.Default.AutoFitWindow == false)
+            if (Settings.Default.AutoFitWindow == false)
             {
                 SetWindowBehavior();
             }
 
-            ConfigureWindows.GetMainWindow.Scroller.VerticalScrollBarVisibility = Properties.Settings.Default.ScrollEnabled ? ScrollBarVisibility.Auto : ScrollBarVisibility.Disabled;
+            ConfigureWindows.GetMainWindow.Scroller.VerticalScrollBarVisibility = Settings.Default.ScrollEnabled ? ScrollBarVisibility.Auto : ScrollBarVisibility.Disabled;
 
             // Set min size to DPI scaling
             ConfigureWindows.GetMainWindow.MinWidth *= MonitorInfo.DpiScaling;
             ConfigureWindows.GetMainWindow.MinHeight *= MonitorInfo.DpiScaling;
 
-            if (!Properties.Settings.Default.ShowInterface)
+            if (!Settings.Default.ShowInterface)
             {
                 ConfigureWindows.GetMainWindow.TitleBar.Visibility =
                    ConfigureWindows.GetMainWindow.LowerBar.Visibility
@@ -49,24 +52,24 @@ namespace PicView.UILogic.Loading
 
         internal static void ContentRenderedEvent()
         {
-            if (Properties.Settings.Default.StartInFullscreenGallery)
+            if (Settings.Default.StartInFullscreenGallery)
             {
                 _ = GalleryToggle.OpenFullscreenGalleryAsync(true).ConfigureAwait(false);
             }
 
             // Determine prefered UI for startup
-            if (Properties.Settings.Default.Fullscreen)
+            if (Settings.Default.Fullscreen)
             {
-                Sizing.WindowSizing.Fullscreen_Restore(true);
+                Fullscreen_Restore(true);
             }
 
-            else if (Properties.Settings.Default.Width > 0 && Properties.Settings.Default.AutoFitWindow == false)
+            else if (Settings.Default.Width > 0 && Settings.Default.AutoFitWindow == false)
             {
                 SetLastWindowSize();
             }
             else
             {
-                UILogic.Sizing.WindowSizing.SetWindowBehavior();
+                SetWindowBehavior();
             }
 
             // Load image if possible
@@ -77,11 +80,11 @@ namespace PicView.UILogic.Loading
             }
             else
             {
-                _ = ChangeImage.LoadPic.QuickLoadAsync(args[1]).ConfigureAwait(false);
+                _ = LoadPic.QuickLoadAsync(args[1]).ConfigureAwait(false);
                 // TODO maybe load extra images if multiple arguments
             }
 
-            ConfigureSettings.ConfigColors.UpdateColor();
+            ConfigColors.UpdateColor();
 
             // Add dictionaries
             Application.Current.Resources.MergedDictionaries.Add(
@@ -130,7 +133,7 @@ namespace PicView.UILogic.Loading
             LoadGalleryShortcut();
 
             // Update WindowStyle
-            if (!Properties.Settings.Default.ShowInterface)
+            if (!Settings.Default.ShowInterface)
             {
                 GetClickArrowLeft.Opacity =
                 GetClickArrowRight.Opacity =
@@ -148,7 +151,7 @@ namespace PicView.UILogic.Loading
                 GetRestorebutton.Visibility =
                 Visibility.Visible;
             }
-            else if (Properties.Settings.Default.Fullscreen)
+            else if (Settings.Default.Fullscreen)
             {
                 GetClickArrowLeft.Opacity =
                 GetClickArrowRight.Opacity =
@@ -177,7 +180,7 @@ namespace PicView.UILogic.Loading
 
             // Initilize Things!
             InitializeZoom();
-            ChangeImage.History.InstantiateFileHistory();
+            History.InstantiateFileHistory();
 
             // Add things!
             Timers.AddTimers();

+ 30 - 25
PicView/UILogic/Sizing/ScaleImage.cs

@@ -1,9 +1,12 @@
-using PicView.ChangeImage;
+using System;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+using PicView.ChangeImage;
 using PicView.ImageHandling;
 using PicView.PicGallery;
+using PicView.Properties;
 using PicView.UILogic.TransformImage;
-using System;
-using System.Threading.Tasks;
 using static PicView.ChangeImage.Navigation;
 using static PicView.PicGallery.GalleryNavigation;
 using static PicView.UILogic.ConfigureWindows;
@@ -43,7 +46,7 @@ namespace PicView.UILogic.Sizing
                     var pic = preloadValue.BitmapSource;
                     if (pic != null)
                     {
-                        await GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                        await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                         {
                             FitImage(pic.PixelWidth, pic.PixelHeight);
                         });
@@ -55,24 +58,26 @@ namespace PicView.UILogic.Sizing
                     var size = await ImageSizeFunctions.GetImageSizeAsync(Pics[FolderIndex]).ConfigureAwait(false);
                     if (size.HasValue)
                     {
-                        await GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                        await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                         {
                             FitImage(size.Value.Width, size.Value.Height);
                         });
 
                         return true;
                     }
-                    else if (GetMainWindow.MainImage.Source != null)
+
+                    if (GetMainWindow.MainImage.Source != null)
                     {
-                        await GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                        await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                         {
                             FitImage(GetMainWindow.MainImage.Source.Width, GetMainWindow.MainImage.Source.Height);
                         });
                         return true;
                     }
-                    else if (XWidth > 0 && XHeight > 0)
+
+                    if (XWidth > 0 && XHeight > 0)
                     {
-                        await GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                        await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                         {
                             FitImage(XWidth, XHeight);
                         });
@@ -82,7 +87,7 @@ namespace PicView.UILogic.Sizing
             }
             else if (XWidth > 0 && XHeight > 0)
             {
-                await GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                 {
                     FitImage(XWidth, XHeight);
                 });
@@ -90,7 +95,7 @@ namespace PicView.UILogic.Sizing
             }
             else
             {
-                await GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+                await GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                 {
                     if (GetMainWindow.MainImage.Source != null)
                     {
@@ -115,8 +120,8 @@ namespace PicView.UILogic.Sizing
             if (width <= 0 || height <= 0) { return; }
 
             double maxWidth, maxHeight;
-            var borderSpaceHeight = Properties.Settings.Default.Fullscreen ? 0 : GetMainWindow.LowerBar.Height + GetMainWindow.TitleBar.Height + 6;
-            var borderSpaceWidth = Properties.Settings.Default.Fullscreen && Properties.Settings.Default.ShowAltInterfaceButtons ? 0 : 20 * MonitorInfo.DpiScaling;
+            var borderSpaceHeight = Settings.Default.Fullscreen ? 0 : GetMainWindow.LowerBar.Height + GetMainWindow.TitleBar.Height + 6;
+            var borderSpaceWidth = Settings.Default.Fullscreen && Settings.Default.ShowAltInterfaceButtons ? 0 : 20 * MonitorInfo.DpiScaling;
 
             var monitorWidth = (MonitorInfo.WorkArea.Width * MonitorInfo.DpiScaling) - borderSpaceWidth;
             var monitorHeight = (MonitorInfo.WorkArea.Height * MonitorInfo.DpiScaling) - borderSpaceHeight;
@@ -135,9 +140,9 @@ namespace PicView.UILogic.Sizing
                 maxWidth = Math.Min(monitorWidth - padding, width);
                 maxHeight = Math.Min(monitorHeight - PicGalleryItem_Size, height);
             }
-            else if (Properties.Settings.Default.AutoFitWindow) // If non resizeable behaviour
+            else if (Settings.Default.AutoFitWindow) // If non resizeable behaviour
             {
-                if (Properties.Settings.Default.FillImage) // Max to monitor height if scaling enabled, else go by min pixel width
+                if (Settings.Default.FillImage) // Max to monitor height if scaling enabled, else go by min pixel width
                 {
                     maxWidth = monitorWidth;
                     maxHeight = monitorHeight;
@@ -151,7 +156,7 @@ namespace PicView.UILogic.Sizing
             }
             else // Get max width and height, based on window size
             {
-                if (Properties.Settings.Default.FillImage)
+                if (Settings.Default.FillImage)
                 {
                     maxWidth = GetMainWindow.ParentContainer.ActualWidth;
                     maxHeight = GetMainWindow.ParentContainer.ActualHeight;
@@ -174,12 +179,12 @@ namespace PicView.UILogic.Sizing
                     break;
             }
 
-            if (Properties.Settings.Default.ScrollEnabled)
+            if (Settings.Default.ScrollEnabled)
             {
                 GetMainWindow.MainImage.Height = maxWidth * height / width;
                 GetMainWindow.MainImage.Width = maxWidth;
 
-                if (Properties.Settings.Default.AutoFitWindow)
+                if (Settings.Default.AutoFitWindow)
                 {
                     GetMainWindow.ParentContainer.Width = maxWidth;
                     GetMainWindow.ParentContainer.Height = XHeight = height * AspectRatio;
@@ -201,22 +206,22 @@ namespace PicView.UILogic.Sizing
 
             if (GalleryFunctions.IsVerticalFullscreenOpen)
             {
-                GetMainWindow.MainImage.Margin = new System.Windows.Thickness(0, 0, PicGalleryItem_Size, 0);
+                GetMainWindow.MainImage.Margin = new Thickness(0, 0, PicGalleryItem_Size, 0);
             }
             else if (GalleryFunctions.IsHorizontalFullscreenOpen)
             {
-                GetMainWindow.MainImage.Margin = new System.Windows.Thickness(0, 0, 0, PicGalleryItem_Size);
+                GetMainWindow.MainImage.Margin = new Thickness(0, 0, 0, PicGalleryItem_Size);
             }
-            else if (Properties.Settings.Default.AutoFitWindow)
+            else if (Settings.Default.AutoFitWindow)
             {
-                if (Properties.Settings.Default.KeepCentered)
+                if (Settings.Default.KeepCentered)
                 {
                     CenterWindowOnScreen();
                 }
 
                 // Update mainWindow.TitleBar width to dynamically fit new size
                 var x = Rotateint == 0 || Rotateint == 180 ? Math.Max(XWidth, GetMainWindow.MinWidth) : Math.Max(XHeight, GetMainWindow.MinHeight);
-                if (Properties.Settings.Default.ScrollEnabled)
+                if (Settings.Default.ScrollEnabled)
                 {
                     GetMainWindow.TitleText.MaxWidth = x;
                 }
@@ -225,13 +230,13 @@ namespace PicView.UILogic.Sizing
                     GetMainWindow.TitleText.MaxWidth = x - interfaceSize < interfaceSize ? interfaceSize : x - interfaceSize;
                 }
 
-                GetMainWindow.MainImage.Margin = new System.Windows.Thickness(0);
+                GetMainWindow.MainImage.Margin = new Thickness(0);
             }
             else
             {
                 // Fix title width to window size
                 GetMainWindow.TitleText.MaxWidth = GetMainWindow.ActualWidth - interfaceSize;
-                GetMainWindow.MainImage.Margin = new System.Windows.Thickness(0);
+                GetMainWindow.MainImage.Margin = new Thickness(0);
             }
 
             if (ZoomLogic.translateTransform is not null && ZoomLogic.translateTransform?.X != 0d)

+ 59 - 51
PicView/UILogic/Sizing/WindowSizing.cs

@@ -1,7 +1,11 @@
-using PicView.PicGallery;
-using PicView.SystemIntegration;
-using System.Windows;
+using System.Windows;
 using System.Windows.Input;
+using PicView.ChangeImage;
+using PicView.FileHandling;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.SystemIntegration;
+using PicView.Views.UserControls;
 using static PicView.UILogic.ConfigureWindows;
 using static PicView.UILogic.HideInterfaceLogic;
 using static PicView.UILogic.Sizing.ScaleImage;
@@ -21,7 +25,7 @@ namespace PicView.UILogic.Sizing
         /// </summary>
         internal static void SetWindowBehavior()
         {
-            if (Properties.Settings.Default.AutoFitWindow)
+            if (Settings.Default.AutoFitWindow)
             {
                 GetMainWindow.SizeToContent = SizeToContent.WidthAndHeight;
                 GetMainWindow.ResizeMode = ResizeMode.CanMinimize;
@@ -37,6 +41,13 @@ namespace PicView.UILogic.Sizing
                 }
 
                 GetMainWindow.WindowState = WindowState.Normal;
+
+                GetMainWindow.Width =
+                GetMainWindow.Height =
+                GetMainWindow.ParentContainer.Width =
+                GetMainWindow.ParentContainer.Height =
+                GetMainWindow.MainImageBorder.Width =
+                GetMainWindow.MainImageBorder.Height = double.NaN;
             }
             else
             {
@@ -45,7 +56,7 @@ namespace PicView.UILogic.Sizing
 
                 if (GetGripButton is null)
                 {
-                    GetGripButton = new Views.UserControls.GripButton();
+                    GetGripButton = new GripButton();
                     GetMainWindow.LowerBar.Children.Add(GetGripButton);
                 }
                 GetGripButton.Visibility = Visibility.Visible;
@@ -54,6 +65,9 @@ namespace PicView.UILogic.Sizing
                 {
                     GetQuickSettingsMenu.SetFit.IsChecked = false;
                 }
+
+                GetMainWindow.ParentContainer.Width = GetMainWindow.Width;
+                GetMainWindow.ParentContainer.Height = GetMainWindow.Height;
             }
         }
 
@@ -82,9 +96,9 @@ namespace PicView.UILogic.Sizing
 
             if (e.ClickCount == 2)
             {
-                if (Properties.Settings.Default.AutoFitWindow)
+                if (Settings.Default.AutoFitWindow)
                 {
-                    Properties.Settings.Default.AutoFitWindow = false;
+                    Settings.Default.AutoFitWindow = false;
                     SetWindowBehavior();
                 }
                 SetMaximized();
@@ -128,7 +142,7 @@ namespace PicView.UILogic.Sizing
         internal static void Restore_From_Move()
         {
             GetMainWindow.WindowState = WindowState.Normal;
-            Properties.Settings.Default.Maximized = false;
+            Settings.Default.Maximized = false;
             GetGripButton.Visibility = Visibility.Visible;
 
             // Reset margin
@@ -141,7 +155,7 @@ namespace PicView.UILogic.Sizing
         /// </summary>
         internal static void Fullscreen_Restore(bool forceFullscreen = false)
         {
-            if (forceFullscreen || !Properties.Settings.Default.Fullscreen)
+            if (forceFullscreen || !Settings.Default.Fullscreen)
             {
                 // Show fullscreen logic
                 RenderFullscreen();
@@ -153,17 +167,17 @@ namespace PicView.UILogic.Sizing
                     GalleryNavigation.ScrollTo();
                 }
 
-                ShowNavigation(Properties.Settings.Default.ShowAltInterfaceButtons);
-                ShowShortcuts(Properties.Settings.Default.ShowAltInterfaceButtons);
+                ShowNavigation(Settings.Default.ShowAltInterfaceButtons);
+                ShowShortcuts(Settings.Default.ShowAltInterfaceButtons);
 
-                Properties.Settings.Default.Fullscreen = true;
+                Settings.Default.Fullscreen = true;
             }
             else
             {
-                GetMainWindow.Topmost = Properties.Settings.Default.TopMost;
-                Properties.Settings.Default.Fullscreen = false;
+                GetMainWindow.Topmost = Settings.Default.TopMost;
+                Settings.Default.Fullscreen = false;
 
-                if (Properties.Settings.Default.ShowInterface)
+                if (Settings.Default.ShowInterface)
                 {
                     ShowNavigation(false);
                     ShowTopandBottom(true);
@@ -176,31 +190,23 @@ namespace PicView.UILogic.Sizing
                     ShowShortcuts(true);
                 }
 
-                GetMainWindow.WindowState = WindowState.Normal;
                 // Reset margin from fullscreen
                 GetMainWindow.ParentContainer.Margin = new Thickness(0);
                 GetMainWindow.TitleBar.Margin = new Thickness(0);
                 GetMainWindow.LowerBar.Margin = new Thickness(0);
 
-                SetWindowBehavior();
-
-                if (Properties.Settings.Default.AutoFitWindow)
-                {
-                    GetMainWindow.Width =
-                    GetMainWindow.Height = double.NaN;
-                }
-                else
+                if (Settings.Default.AutoFitWindow == false)
                 {
                     SetLastWindowSize();
-                    GetMainWindow.ParentContainer.Width = GetMainWindow.Width;
-                    GetMainWindow.ParentContainer.Height = GetMainWindow.Height;
                 }
 
+                SetWindowBehavior();
+
+
                 if (Slideshow.SlideTimer != null && Slideshow.SlideTimer.Enabled)
                 {
                     Slideshow.SlideTimer.Enabled = false;
                 }
-                ConfigureSettings.ConfigColors.UpdateColor(); // Regain border
 
                 _ = TryFitImageAsync();
             }
@@ -208,6 +214,8 @@ namespace PicView.UILogic.Sizing
 
         internal static void RenderFullscreen()
         {
+            SetWindowSize();
+
             ShowTopandBottom(false);
             GetMainWindow.Topmost = true;
 
@@ -243,7 +251,7 @@ namespace PicView.UILogic.Sizing
 
             GetMainWindow.TitleText.MaxWidth = MonitorInfo.WorkArea.Width - 192 * MonitorInfo.DpiScaling;
 
-            Properties.Settings.Default.Maximized = true;
+            Settings.Default.Maximized = true;
         }
 
         /// <summary>
@@ -259,10 +267,10 @@ namespace PicView.UILogic.Sizing
         {
             GetMainWindow.Dispatcher.Invoke(() =>
             {
-                GetMainWindow.Top = Properties.Settings.Default.Top;
-                GetMainWindow.Left = Properties.Settings.Default.Left;
-                GetMainWindow.Width = Properties.Settings.Default.Width;
-                GetMainWindow.Height = Properties.Settings.Default.Height;
+                GetMainWindow.Top = Settings.Default.Top;
+                GetMainWindow.Left = Settings.Default.Left;
+                GetMainWindow.Width = Settings.Default.Width;
+                GetMainWindow.Height = Settings.Default.Height;
             });
         }
 
@@ -270,12 +278,12 @@ namespace PicView.UILogic.Sizing
         {
             GetMainWindow.Dispatcher.Invoke(() =>
             {
-                Properties.Settings.Default.Top = GetMainWindow.Top;
-                Properties.Settings.Default.Left = GetMainWindow.Left;
-                Properties.Settings.Default.Height = GetMainWindow.Height;
-                Properties.Settings.Default.Width = GetMainWindow.Width;
+                Settings.Default.Top = GetMainWindow.Top;
+                Settings.Default.Left = GetMainWindow.Left;
+                Settings.Default.Height = GetMainWindow.Height;
+                Settings.Default.Width = GetMainWindow.Width;
 
-                Properties.Settings.Default.Save();
+                Settings.Default.Save();
             });
         }
 
@@ -288,7 +296,7 @@ namespace PicView.UILogic.Sizing
             switch (GetMainWindow.WindowState)
             {
                 case WindowState.Normal:
-                    if (Properties.Settings.Default.Fullscreen)
+                    if (Settings.Default.Fullscreen)
                     {
                         Fullscreen_Restore();
                     }
@@ -317,15 +325,15 @@ namespace PicView.UILogic.Sizing
         /// <param name="e"></param>
         internal static void Window_Closing()
         {
-            if (!Properties.Settings.Default.AutoFitWindow && !Properties.Settings.Default.Fullscreen)
+            if (!Settings.Default.AutoFitWindow && !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;
+                Settings.Default.Top = GetMainWindow.Top;
+                Settings.Default.Left = GetMainWindow.Left;
+                Settings.Default.Height = GetMainWindow.Height;
+                Settings.Default.Width = GetMainWindow.Width;
             }
 
-            ChangeImage.Navigation.Pics.Clear(); // Make it cancel task
+            Navigation.Pics.Clear(); // Make it cancel task
 
             GetMainWindow.Hide(); // Make it feel faster
 
@@ -340,23 +348,23 @@ namespace PicView.UILogic.Sizing
 
             if (GalleryFunctions.IsVerticalFullscreenOpen || GalleryFunctions.IsHorizontalFullscreenOpen)
             {
-                if (Properties.Settings.Default.FullscreenGalleryHorizontal || Properties.Settings.Default.FullscreenGalleryVertical)
+                if (Settings.Default.FullscreenGalleryHorizontal || Settings.Default.FullscreenGalleryVertical)
                 {
-                    Properties.Settings.Default.StartInFullscreenGallery = true;
+                    Settings.Default.StartInFullscreenGallery = true;
                 }
                 else
                 {
-                    Properties.Settings.Default.StartInFullscreenGallery = false;
+                    Settings.Default.StartInFullscreenGallery = false;
                 }
             }
             else
             {
-                Properties.Settings.Default.StartInFullscreenGallery = false;
+                Settings.Default.StartInFullscreenGallery = false;
             }
 
-            Properties.Settings.Default.Save();
-            FileHandling.DeleteFiles.DeleteTempFiles();
-            ChangeImage.History.WriteToFile();
+            Settings.Default.Save();
+            DeleteFiles.DeleteTempFiles();
+            History.WriteToFile();
             Application.Current.Shutdown();
         }
     }

+ 10 - 8
PicView/UILogic/Slideshow.cs

@@ -1,9 +1,11 @@
-using PicView.Animations;
-using PicView.SystemIntegration;
-using System;
+using System;
 using System.Threading.Tasks;
 using System.Timers;
 using System.Windows;
+using PicView.Animations;
+using PicView.Properties;
+using PicView.SystemIntegration;
+using PicView.UILogic.Sizing;
 using static PicView.ChangeImage.Navigation;
 
 namespace PicView.UILogic
@@ -29,9 +31,9 @@ namespace PicView.UILogic
 
             if (SlideTimer == null)
             {
-                SlideTimer = new Timer()
+                SlideTimer = new Timer
                 {
-                    Interval = Properties.Settings.Default.SlideTimer,
+                    Interval = Settings.Default.SlideTimer,
                     Enabled = true
                 };
                 SlideTimer.Elapsed += async delegate { await SlideTimer_Elapsed().ConfigureAwait(false); };
@@ -44,7 +46,7 @@ namespace PicView.UILogic
 
             if (ConfigureWindows.GetMainWindow.WindowState == WindowState.Normal)
             {
-                UILogic.Sizing.WindowSizing.RenderFullscreen();
+                WindowSizing.RenderFullscreen();
             }
 
             _ = NativeMethods.SetThreadExecutionState(NativeMethods.ES_CONTINUOUS | NativeMethods.ES_DISPLAY_REQUIRED); // Stop screensaver when running
@@ -57,9 +59,9 @@ namespace PicView.UILogic
         {
             SlideTimer?.Stop();
 
-            if (!Properties.Settings.Default.Fullscreen)
+            if (!Settings.Default.Fullscreen)
             {
-                UILogic.Sizing.WindowSizing.Fullscreen_Restore();
+                WindowSizing.Fullscreen_Restore();
             }
 
             _ = NativeMethods.SetThreadExecutionState(NativeMethods.ES_CONTINUOUS); // Allow screensaver again

+ 5 - 3
PicView/UILogic/Timers.cs

@@ -1,5 +1,7 @@
 using System;
 using System.Timers;
+using System.Windows.Threading;
+using PicView.PicGallery;
 using static PicView.Animations.FadeControls;
 using static PicView.UILogic.TransformImage.Scroll;
 
@@ -12,7 +14,7 @@ namespace PicView.UILogic
         {
             AutoScrollTimer.Elapsed += AutoScrollTimerEvent;
 
-            ActivityTimer = new Timer()
+            ActivityTimer = new Timer
             {
                 Interval = 6000,
                 AutoReset = true,
@@ -33,9 +35,9 @@ namespace PicView.UILogic
             {
                 try
                 {
-                    await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, (Action)(() =>
+                    await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)(() =>
                     {
-                        PicGallery.GalleryNavigation.ScrollTo();
+                        GalleryNavigation.ScrollTo();
                     }));
                 }
                 catch (Exception)

+ 2 - 2
PicView/UILogic/Tooltip.cs

@@ -1,7 +1,7 @@
-using PicView.Animations;
-using System;
+using System;
 using System.Windows;
 using System.Windows.Media.Animation;
+using PicView.Animations;
 using static PicView.UILogic.UC;
 
 namespace PicView.UILogic

+ 9 - 7
PicView/UILogic/TransformImage/Rotation.cs

@@ -1,8 +1,10 @@
-using PicView.PicGallery;
-using PicView.UILogic.Sizing;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media;
+using PicView.PicGallery;
+using PicView.Properties;
+using PicView.SystemIntegration;
+using PicView.UILogic.Sizing;
 
 namespace PicView.UILogic.TransformImage
 {
@@ -18,12 +20,12 @@ namespace PicView.UILogic.TransformImage
         internal static async Task RotateAndMoveCursor(bool right, UIElement uIElement)
         {
             Rotate(right);
-            if (Properties.Settings.Default.AutoFitWindow == false) { return; }
+            if (Settings.Default.AutoFitWindow == false) { return; }
 
             // Move cursor after rotating
             await Task.Delay(50).ConfigureAwait(true); // Delay it, so that the move takes place after window has resized
-            var p = uIElement.PointToScreen(new System.Windows.Point(25, 25));
-            SystemIntegration.NativeMethods.SetCursorPos((int)p.X, (int)p.Y);
+            var p = uIElement.PointToScreen(new Point(25, 25));
+            NativeMethods.SetCursorPos((int)p.X, (int)p.Y);
         }
 
         /// <summary>
@@ -63,7 +65,7 @@ namespace PicView.UILogic.TransformImage
         internal static void Rotate(bool right)
         {
             if (ConfigureWindows.GetMainWindow.MainImage.Source == null ||
-                Properties.Settings.Default.FullscreenGalleryHorizontal == false && GalleryFunctions.IsHorizontalOpen)
+                Settings.Default.FullscreenGalleryHorizontal == false && GalleryFunctions.IsHorizontalOpen)
             { return; }
 
             if (right)

+ 8 - 5
PicView/UILogic/TransformImage/Scroll.cs

@@ -3,6 +3,9 @@ using System.Timers;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
+using System.Windows.Threading;
+using PicView.ChangeImage;
+using PicView.Properties;
 using static PicView.UILogic.Sizing.ScaleImage;
 using static PicView.UILogic.Tooltip;
 using static PicView.UILogic.UC;
@@ -21,7 +24,7 @@ namespace PicView.UILogic.TransformImage
         /// </summary>
         internal static Point? AutoScrollPos { get; set; }
 
-        internal static readonly Timer AutoScrollTimer = new Timer()
+        internal static readonly Timer AutoScrollTimer = new Timer
         {
             Interval = 7,
             AutoReset = true,
@@ -35,8 +38,8 @@ namespace PicView.UILogic.TransformImage
         /// </summary>
         internal static async Task SetScrollBehaviour(bool scrolling)
         {
-            Properties.Settings.Default.ScrollEnabled = scrolling;
-            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
+            Settings.Default.ScrollEnabled = scrolling;
+            await ConfigureWindows.GetMainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
             {
                 ConfigureWindows.GetMainWindow.Scroller.VerticalScrollBarVisibility =
                     scrolling ? ScrollBarVisibility.Auto : ScrollBarVisibility.Disabled;
@@ -44,10 +47,10 @@ namespace PicView.UILogic.TransformImage
 
             // TODO fix error when image is from web
 
-            if (ChangeImage.Navigation.Pics != null)
+            if (Navigation.Pics != null)
             {
                 await TryFitImageAsync().ConfigureAwait(false);
-                if (ChangeImage.Navigation.FreshStartup == false)
+                if (Navigation.FreshStartup == false)
                 {
                     ShowTooltipMessage(scrolling ? Application.Current.Resources["ScrollingEnabled"] : Application.Current.Resources["ScrollingDisabled"]);
                 }

+ 6 - 6
PicView/UILogic/TransformImage/Zoom.cs

@@ -1,10 +1,11 @@
-using PicView.PicGallery;
-using System;
+using System;
 using System.Linq;
 using System.Windows;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media.Animation;
+using System.Windows.Threading;
+using PicView.Properties;
 using static PicView.ChangeImage.Navigation;
 
 namespace PicView.UILogic.TransformImage
@@ -131,7 +132,7 @@ namespace PicView.UILogic.TransformImage
             var newYproperty = origin.Y - dragMousePosition.Y;
 
             // Keep panning it in bounds 
-            if (Properties.Settings.Default.AutoFitWindow && Properties.Settings.Default.Fullscreen == false) // TODO develop solution where you can keep window in bounds when using normal window behavior and fullscreen
+            if (Settings.Default.AutoFitWindow && Settings.Default.Fullscreen == false) // TODO develop solution where you can keep window in bounds when using normal window behavior and fullscreen
             {
                 var isXOutOfBorder = ConfigureWindows.GetMainWindow.Scroller.ActualWidth < (ConfigureWindows.GetMainWindow.MainImageBorder.ActualWidth * scaleTransform.ScaleX);
                 var isYOutOfBorder = ConfigureWindows.GetMainWindow.Scroller.ActualHeight < (ConfigureWindows.GetMainWindow.MainImageBorder.ActualHeight * scaleTransform.ScaleY);
@@ -214,7 +215,7 @@ namespace PicView.UILogic.TransformImage
             ZoomValue = scaleTransform.ScaleX;
 
             /// Determine zoom speed
-            var zoomSpeed = Properties.Settings.Default.ZoomSpeed;
+            var zoomSpeed = Settings.Default.ZoomSpeed;
 
             // Increase speed determined by how much is zoomed in
             // TODO improve it when zoomed greatly in
@@ -235,7 +236,6 @@ namespace PicView.UILogic.TransformImage
                 case > 1.6:
                     zoomSpeed += .5;
                     break;
-                default: break;
             }
 
             if (increment == false)
@@ -275,7 +275,7 @@ namespace PicView.UILogic.TransformImage
             {
                 Tooltip.CloseToolTipMessage();
             }
-            ConfigureWindows.GetMainWindow.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, () =>
+            ConfigureWindows.GetMainWindow.Dispatcher.Invoke(DispatcherPriority.Normal, () =>
             {
                 /// Display updated values
                 if (Pics.Count == 0)

+ 7 - 6
PicView/UILogic/UC.cs

@@ -1,10 +1,11 @@
-using PicView.ChangeImage;
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Media.Animation;
+using PicView.ChangeImage;
 using PicView.PicGallery;
 using PicView.Views.UserControls;
 using PicView.Views.UserControls.Misc;
-using System;
-using System.Windows;
-using System.Windows.Media.Animation;
 
 namespace PicView.UILogic
 {
@@ -69,7 +70,7 @@ namespace PicView.UILogic
                     {
                         GetImageSettingsMenu.GoToPic.GoToPicBox.Text =
                             (Navigation.FolderIndex + 1)
-                            .ToString(System.Globalization.CultureInfo.CurrentCulture);
+                            .ToString(CultureInfo.CurrentCulture);
                     }
                 }
             }
@@ -391,7 +392,7 @@ namespace PicView.UILogic
             }
 
             ConfigureWindows.GetMainWindow.ParentContainer.Children.Add(GetStartUpUC);
-            UC.GetStartUpUC.ResponsiveSize(ConfigureWindows.GetMainWindow.Width);
+            GetStartUpUC.ResponsiveSize(ConfigureWindows.GetMainWindow.Width);
         }
     }
 }

+ 4 - 3
PicView/Views/UserControls/Buttons/BackgroundButton.xaml.cs

@@ -1,5 +1,6 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
+using PicView.ConfigureSettings;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -32,7 +33,7 @@ namespace PicView.Views.UserControls
                     AnimationHelper.MouseLeaveBgTexColor(TheButtonBrush);
                 };
 
-                TheButton.Click += (_, _) => ConfigureSettings.ConfigColors.ChangeBackground();
+                TheButton.Click += (_, _) => ConfigColors.ChangeBackground();
             };
         }
     }

+ 2 - 2
PicView/Views/UserControls/Buttons/ClickArrow.xaml.cs

@@ -1,7 +1,7 @@
-using PicView.Animations;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
+using PicView.Animations;
 
 namespace PicView.Views.UserControls
 {

+ 4 - 4
PicView/Views/UserControls/Buttons/CloseButton.xaml.cs

@@ -1,7 +1,7 @@
-using PicView.Animations;
-using PicView.UILogic;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
+using PicView.Animations;
+using PicView.Properties;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -17,7 +17,7 @@ namespace PicView.Views.UserControls
                 MouseEnter += (_, _) => ButtonMouseOverAnim(CloseButtonBrush, true);
                 MouseLeave += (_, _) => ButtonMouseLeaveAnim(CloseButtonBrush, true);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 5 - 4
PicView/Views/UserControls/Buttons/CopyButton.xaml.cs

@@ -1,5 +1,6 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
+using PicView.Properties;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -13,9 +14,9 @@ namespace PicView.Views.UserControls
             Loaded += delegate
             {
                 TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(CopyButtonBrush, true);
-                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CopyButtonBrush, false);
+                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CopyButtonBrush);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 4 - 3
PicView/Views/UserControls/Buttons/FlipButton.xaml.cs

@@ -1,7 +1,8 @@
-using PicView.Animations;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
+using PicView.Animations;
+using PicView.UILogic.TransformImage;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -40,7 +41,7 @@ namespace PicView.Views.UserControls
 
                 TheButton.Click += delegate
                 {
-                    UILogic.TransformImage.Rotation.Flip();
+                    Rotation.Flip();
                 };
 
                 // Change FlipButton's icon when (un)checked

+ 2 - 2
PicView/Views/UserControls/Buttons/FolderButton.xaml.cs

@@ -1,5 +1,5 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
 using static PicView.UILogic.UC;
 
 namespace PicView.Views.UserControls

+ 7 - 6
PicView/Views/UserControls/Buttons/FullscreenButton.xaml.cs

@@ -1,7 +1,8 @@
-using PicView.UILogic;
-using PicView.Animations;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
+using PicView.Animations;
+using PicView.Properties;
+using PicView.UILogic.Sizing;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -14,7 +15,7 @@ namespace PicView.Views.UserControls
 
             MouseEnter += delegate
             {
-                if (Properties.Settings.Default.Fullscreen)
+                if (Settings.Default.Fullscreen)
                 {
                     ToolTip = Application.Current.Resources["RestoreDown"];
                 }
@@ -33,10 +34,10 @@ namespace PicView.Views.UserControls
 
             TheButton.Click += delegate
             {
-                UILogic.Sizing.WindowSizing.Fullscreen_Restore();
+                WindowSizing.Fullscreen_Restore();
             };
 
-            if (!Properties.Settings.Default.DarkTheme)
+            if (!Settings.Default.DarkTheme)
             {
                 AnimationHelper.LightThemeMouseEvent(this, IconBrush);
             }

+ 2 - 2
PicView/Views/UserControls/Buttons/GalleryShortcut.xaml.cs

@@ -1,6 +1,6 @@
-using PicView.Animations;
+using System.Windows.Controls;
+using PicView.Animations;
 using PicView.PicGallery;
-using System.Windows.Controls;
 
 namespace PicView.Views.UserControls
 {

+ 11 - 9
PicView/Views/UserControls/Buttons/GoToPicButton.xaml.cs

@@ -1,12 +1,14 @@
-using PicView.Animations;
-using PicView.ChangeImage;
-using PicView.UILogic;
-using System.Globalization;
+using System.Globalization;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
+using PicView.Animations;
+using PicView.ChangeImage;
+using PicView.ConfigureSettings;
+using PicView.Properties;
+using PicView.UILogic;
 using static PicView.Animations.MouseOverAnimations;
 using static PicView.ChangeImage.Navigation;
 using static PicView.UILogic.UC;
@@ -22,10 +24,10 @@ namespace PicView.Views.UserControls
             Loaded += delegate
             {
                 TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(GoToPicBrush, true);
-                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(GoToPicBrush, false);
+                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(GoToPicBrush);
                 TheButton.Click += async (s, x) => await GoToPicEventAsync(s, x).ConfigureAwait(false);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush1);
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush2);
@@ -33,7 +35,7 @@ namespace PicView.Views.UserControls
 
                 GoToPicBox.PreviewMouseLeftButtonDown += delegate
                 {
-                    GoToPicBox.CaretBrush = new SolidColorBrush(ConfigureSettings.ConfigColors.MainColor);
+                    GoToPicBox.CaretBrush = new SolidColorBrush(ConfigColors.MainColor);
                 };
                 GoToPicBox.PreviewKeyDown += async (s, x) => await GoToPicPreviewKeysAsync(s, x).ConfigureAwait(false);
             };
@@ -41,12 +43,12 @@ namespace PicView.Views.UserControls
 
         internal static async Task GoToPicEventAsync(object sender, RoutedEventArgs e)
         {
-            if (ChangeImage.ErrorHandling.CheckOutOfRange())
+            if (ErrorHandling.CheckOutOfRange())
             {
                 return;
             }
 
-            if (int.TryParse(GetImageSettingsMenu.GoToPic.GoToPicBox.Text.ToString(), out int x))
+            if (int.TryParse(GetImageSettingsMenu.GoToPic.GoToPicBox.Text, out int x))
             {
                 x--;
                 x = x <= 0 ? 0 : x;

+ 5 - 4
PicView/Views/UserControls/Buttons/ImageInfoButton.xaml.cs

@@ -1,5 +1,6 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
+using PicView.UILogic;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -27,8 +28,8 @@ namespace PicView.Views.UserControls
 
                 TheButton.Click += (_, _) =>
                 {
-                    UILogic.UC.Close_UserControls();
-                    UILogic.ConfigureWindows.ImageInfoWindow();
+                    UC.Close_UserControls();
+                    ConfigureWindows.ImageInfoWindow();
                 };
             };
         }

+ 4 - 3
PicView/Views/UserControls/Buttons/InfoButton.xaml.cs

@@ -1,5 +1,6 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
+using PicView.UILogic;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -26,7 +27,7 @@ namespace PicView.Views.UserControls
                     AnimationHelper.MouseLeaveBgTexColor(TheButtonBrush);
                 };
 
-                TheButton.Click += (_, _) => UILogic.ConfigureWindows.InfoWindow();
+                TheButton.Click += (_, _) => ConfigureWindows.InfoWindow();
             };
         }
     }

+ 2 - 2
PicView/Views/UserControls/Buttons/LefttButton.xaml.cs

@@ -1,6 +1,6 @@
-using PicView.ChangeImage;
+using System.Windows.Controls;
 using PicView.Animations;
-using System.Windows.Controls;
+using PicView.ChangeImage;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls

+ 5 - 4
PicView/Views/UserControls/Buttons/LinkButton.xaml.cs

@@ -1,5 +1,6 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
+using PicView.Properties;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -13,9 +14,9 @@ namespace PicView.Views.UserControls
             Loaded += delegate
             {
                 TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(CopyButtonBrush, true);
-                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CopyButtonBrush, false);
+                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CopyButtonBrush);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 5 - 4
PicView/Views/UserControls/Buttons/MenuCloseButton.xaml.cs

@@ -1,6 +1,7 @@
-using PicView.UILogic;
+using System.Windows.Controls;
 using PicView.Animations;
-using System.Windows.Controls;
+using PicView.Properties;
+using PicView.UILogic;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -14,9 +15,9 @@ namespace PicView.Views.UserControls
             Loaded += delegate
             {
                 MouseEnter += (s, x) => ButtonMouseOverAnim(CloseButtonBrush, true);
-                MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CloseButtonBrush, false);
+                MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CloseButtonBrush);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 4 - 4
PicView/Views/UserControls/Buttons/MinButton.xaml.cs

@@ -1,8 +1,8 @@
-using PicView.Animations;
-using PicView.UILogic;
-using System.Linq;
+using System.Linq;
 using System.Windows;
 using System.Windows.Controls;
+using PicView.Animations;
+using PicView.Properties;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -19,7 +19,7 @@ namespace PicView.Views.UserControls
 
                 MouseEnter += (s, x) => ButtonMouseOverAnim(MinButtonBrush, true);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 4 - 3
PicView/Views/UserControls/Buttons/Minus.xaml.cs

@@ -1,6 +1,7 @@
-using PicView.Animations;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
+using PicView.Animations;
+using PicView.UILogic;
 
 namespace PicView.Views.UserControls
 {
@@ -23,7 +24,7 @@ namespace PicView.Views.UserControls
                 MouseOverAnimations.AltInterfaceMouseLeave(PolyFill, CanvasBGcolor, BorderBrushKey);
             };
 
-            TheButton.Click += (_, _) => SystemCommands.MinimizeWindow(UILogic.ConfigureWindows.GetMainWindow);
+            TheButton.Click += (_, _) => SystemCommands.MinimizeWindow(ConfigureWindows.GetMainWindow);
         }
     }
 }

+ 4 - 3
PicView/Views/UserControls/Buttons/OptimizeButton.xaml.cs

@@ -1,6 +1,7 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
 using System.Windows.Media;
+using PicView.Animations;
+using PicView.ImageHandling;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -36,7 +37,7 @@ namespace PicView.Views.UserControls
                     AnimationHelper.MouseLeaveBgTexColor(ButtonBrush);
                 };
 
-                TheButton.Click += async (_, _) => await ImageHandling.ImageFunctions.OptimizeImageAsyncWithErrorChecking().ConfigureAwait(false);
+                TheButton.Click += async (_, _) => await ImageFunctions.OptimizeImageAsyncWithErrorChecking().ConfigureAwait(false);
             };
         }
     }

+ 5 - 4
PicView/Views/UserControls/Buttons/PasteButton.xaml.cs

@@ -1,6 +1,7 @@
-using PicView.Animations;
+using System.Windows.Controls;
+using PicView.Animations;
 using PicView.FileHandling;
-using System.Windows.Controls;
+using PicView.Properties;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -14,9 +15,9 @@ namespace PicView.Views.UserControls
             Loaded += delegate
             {
                 TheButton.MouseEnter += (_, _) => ButtonMouseOverAnim(PasteButtonBrush, true);
-                TheButton.MouseLeave += (_, _) => ButtonMouseLeaveAnimBgColor(PasteButtonBrush, false);
+                TheButton.MouseLeave += (_, _) => ButtonMouseLeaveAnimBgColor(PasteButtonBrush);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 5 - 4
PicView/Views/UserControls/Buttons/RecycleButton.xaml.cs

@@ -1,6 +1,7 @@
-using PicView.FileHandling;
+using System.Windows.Controls;
 using PicView.Animations;
-using System.Windows.Controls;
+using PicView.FileHandling;
+using PicView.Properties;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -14,9 +15,9 @@ namespace PicView.Views.UserControls
             Loaded += delegate
             {
                 TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(RecycleButtonBrush, true);
-                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(RecycleButtonBrush, false);
+                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(RecycleButtonBrush);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 5 - 4
PicView/Views/UserControls/Buttons/ReloadButton.xaml.cs

@@ -1,6 +1,7 @@
-using PicView.ChangeImage;
+using System.Windows.Controls;
 using PicView.Animations;
-using System.Windows.Controls;
+using PicView.ChangeImage;
+using PicView.Properties;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -14,9 +15,9 @@ namespace PicView.Views.UserControls
             Loaded += delegate
             {
                 TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(ReloadButtonBrush, true);
-                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(ReloadButtonBrush, false);
+                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(ReloadButtonBrush);
 
-                if (!Properties.Settings.Default.DarkTheme)
+                if (!Settings.Default.DarkTheme)
                 {
                     AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                 }

+ 5 - 4
PicView/Views/UserControls/Buttons/ResizeButton.xaml.cs

@@ -1,8 +1,9 @@
-using PicView.Animations;
-using PicView.UILogic;
-using PicView.UILogic.Loading;
+using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
+using PicView.Animations;
+using PicView.UILogic;
+using PicView.UILogic.Loading;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -47,7 +48,7 @@ namespace PicView.Views.UserControls
             {
                 LoadControls.LoadQuickResize();
             }
-            if (UC.GetQuickResize.Visibility == System.Windows.Visibility.Collapsed)
+            if (UC.GetQuickResize.Visibility == Visibility.Collapsed)
             {
                 UC.GetQuickResize.Show();
             }

+ 6 - 4
PicView/Views/UserControls/Buttons/RestoreButton.xaml.cs

@@ -1,6 +1,8 @@
-using PicView.Animations;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
+using PicView.Animations;
+using PicView.Properties;
+using PicView.UILogic.Sizing;
 
 namespace PicView.Views.UserControls
 {
@@ -13,11 +15,11 @@ namespace PicView.Views.UserControls
         {
             InitializeComponent();
 
-            TheButton.Click += delegate { UILogic.Sizing.WindowSizing.Fullscreen_Restore(); };
+            TheButton.Click += delegate { WindowSizing.Fullscreen_Restore(); };
 
             MouseEnter += delegate
             {
-                if (!Properties.Settings.Default.Fullscreen)
+                if (!Settings.Default.Fullscreen)
                 {
                     ToolTip = Application.Current.Resources["Fullscreen"];
                 }

+ 2 - 2
PicView/Views/UserControls/Buttons/RightButton.xaml.cs

@@ -1,6 +1,6 @@
-using PicView.ChangeImage;
+using System.Windows.Controls;
 using PicView.Animations;
-using System.Windows.Controls;
+using PicView.ChangeImage;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls

+ 4 - 3
PicView/Views/UserControls/Buttons/RotateLeftButton.xaml.cs

@@ -1,5 +1,6 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
+using PicView.UILogic.TransformImage;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -31,7 +32,7 @@ namespace PicView.Views.UserControls
                     AnimationHelper.MouseLeaveBgTexColor(TheButtonBrush);
                 };
 
-                TheButton.Click += async (_, _) => await UILogic.TransformImage.Rotation.RotateAndMoveCursor(false, TheButton).ConfigureAwait(false);
+                TheButton.Click += async (_, _) => await Rotation.RotateAndMoveCursor(false, TheButton).ConfigureAwait(false);
             };
         }
     }

+ 4 - 3
PicView/Views/UserControls/Buttons/RotateRightButton.xaml.cs

@@ -1,5 +1,6 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
+using PicView.UILogic.TransformImage;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls
@@ -31,7 +32,7 @@ namespace PicView.Views.UserControls
                     AnimationHelper.MouseLeaveBgTexColor(TheButtonBrush);
                 };
 
-                TheButton.Click += async (_, _) => await UILogic.TransformImage.Rotation.RotateAndMoveCursor(true, TheButton).ConfigureAwait(false);
+                TheButton.Click += async (_, _) => await Rotation.RotateAndMoveCursor(true, TheButton).ConfigureAwait(false);
             };
         }
     }

+ 2 - 2
PicView/Views/UserControls/Buttons/SettingsButton.xaml.cs

@@ -1,5 +1,5 @@
-using PicView.Animations;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using PicView.Animations;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls

+ 3 - 3
PicView/Views/UserControls/Buttons/SlideshowButton.xaml.cs

@@ -1,7 +1,7 @@
-using PicView.UILogic;
-using PicView.Animations;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
+using PicView.Animations;
+using PicView.UILogic;
 using static PicView.Animations.MouseOverAnimations;
 
 namespace PicView.Views.UserControls

Some files were not shown because too many files changed in this diff