Răsfoiți Sursa

Rename FunctionsHelper.cs to FunctionsMapper.cs, refactor.

Ruben 7 luni în urmă
părinte
comite
4b5c1601c2

+ 7 - 7
src/PicView.Avalonia.MacOS/App.axaml.cs

@@ -158,7 +158,7 @@ public class App : Application, IPlatformSpecificService
                 }       
                 }       
             }
             }
 
 
-            _ = FunctionsHelper.CloseMenus();
+            _ = FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -203,7 +203,7 @@ public class App : Application, IPlatformSpecificService
                 }      
                 }      
             }
             }
 
 
-            _ = FunctionsHelper.CloseMenus();
+            _ = FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -248,7 +248,7 @@ public class App : Application, IPlatformSpecificService
                 }      
                 }      
             }
             }
 
 
-            _ = FunctionsHelper.CloseMenus();
+            _ = FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -290,7 +290,7 @@ public class App : Application, IPlatformSpecificService
                     _settingsWindow.Show();
                     _settingsWindow.Show();
                 }     
                 }     
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
             
             
         }
         }
     }
     }
@@ -333,7 +333,7 @@ public class App : Application, IPlatformSpecificService
                     _effectsWindow.Show();
                     _effectsWindow.Show();
                 }   
                 }   
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -375,7 +375,7 @@ public class App : Application, IPlatformSpecificService
                     _singleImageResizeWindow.Show();
                     _singleImageResizeWindow.Show();
                 }  
                 }  
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -417,7 +417,7 @@ public class App : Application, IPlatformSpecificService
                     _batchResizeWindow.Show();
                     _batchResizeWindow.Show();
                 }  
                 }  
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
         }   
         }   
     }
     }
 
 

+ 7 - 7
src/PicView.Avalonia.Win32/App.axaml.cs

@@ -200,7 +200,7 @@ public partial class App : Application, IPlatformSpecificService
                 }       
                 }       
             }
             }
 
 
-            _ = FunctionsHelper.CloseMenus();
+            _ = FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -245,7 +245,7 @@ public partial class App : Application, IPlatformSpecificService
                 }       
                 }       
             }
             }
 
 
-            _ = FunctionsHelper.CloseMenus();
+            _ = FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -290,7 +290,7 @@ public partial class App : Application, IPlatformSpecificService
                 }       
                 }       
             }
             }
 
 
-            _ = FunctionsHelper.CloseMenus();
+            _ = FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 
@@ -332,7 +332,7 @@ public partial class App : Application, IPlatformSpecificService
                     _settingsWindow.Show();
                     _settingsWindow.Show();
                 }         
                 }         
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
             
             
         }
         }
     }
     }
@@ -375,7 +375,7 @@ public partial class App : Application, IPlatformSpecificService
                     _singleImageResizeWindow.Show();
                     _singleImageResizeWindow.Show();
                 }         
                 }         
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
         }
         }
     }
     }
     
     
@@ -417,7 +417,7 @@ public partial class App : Application, IPlatformSpecificService
                     _batchResizeWindow.Show();
                     _batchResizeWindow.Show();
                 }
                 }
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
         }   
         }   
     }
     }
     
     
@@ -459,7 +459,7 @@ public partial class App : Application, IPlatformSpecificService
                     _effectsWindow.Show();
                     _effectsWindow.Show();
                 }
                 }
             }
             }
-            _= FunctionsHelper.CloseMenus();
+            _= FunctionsMapper.CloseMenus();
         }
         }
     }
     }
 
 

+ 1 - 1
src/PicView.Avalonia/Crop/CropFunctions.cs

@@ -63,7 +63,7 @@ public static class CropFunctions
         vm.Title = TranslationHelper.Translation.CropMessage;
         vm.Title = TranslationHelper.Translation.CropMessage;
         vm.TitleTooltip = TranslationHelper.Translation.CropMessage;
         vm.TitleTooltip = TranslationHelper.Translation.CropMessage;
         
         
-        FunctionsHelper.CloseMenus();
+        FunctionsMapper.CloseMenus();
     }
     }
     
     
     public static void CloseCropControl(MainViewModel vm)
     public static void CloseCropControl(MainViewModel vm)

+ 1 - 1
src/PicView.Avalonia/Crop/CropKeyboardManager.cs

@@ -62,7 +62,7 @@ public class CropKeyboardManager(CropControl control)
 
 
         if (KeybindingManager.CustomShortcuts.TryGetValue(currentKeys, out var func))
         if (KeybindingManager.CustomShortcuts.TryGetValue(currentKeys, out var func))
         {
         {
-            var function = await FunctionsHelper.GetFunctionByName(func.Method.Name);
+            var function = await FunctionsMapper.GetFunctionByName(func.Method.Name);
             switch (function.Method.Name)
             switch (function.Method.Name)
             {
             {
                 case "Up":
                 case "Up":

+ 1 - 1
src/PicView.Avalonia/CustomControls/KeybindTextBox.cs

@@ -117,7 +117,7 @@ public class KeybindTextBox : TextBox
 
 
         KeybindingManager.CustomShortcuts.Remove(new KeyGesture(e.Key, e.KeyModifiers));
         KeybindingManager.CustomShortcuts.Remove(new KeyGesture(e.Key, e.KeyModifiers));
 
 
-        var function = await FunctionsHelper.GetFunctionByName(MethodName);
+        var function = await FunctionsMapper.GetFunctionByName(MethodName);
 
 
         if (function == null)
         if (function == null)
         {
         {

+ 1 - 1
src/PicView.Avalonia/Input/KeybindingManager.cs

@@ -72,7 +72,7 @@ public static class KeybindingManager
                 {
                 {
                     continue;
                     continue;
                 }
                 }
-                var function = await FunctionsHelper.GetFunctionByName(kvp.Value).ConfigureAwait(false);
+                var function = await FunctionsMapper.GetFunctionByName(kvp.Value).ConfigureAwait(false);
                 // Add to the dictionary
                 // Add to the dictionary
                 CustomShortcuts[gesture] = function;
                 CustomShortcuts[gesture] = function;
             }
             }

+ 3 - 3
src/PicView.Avalonia/Input/MainKeyboardShortcuts.cs

@@ -147,10 +147,10 @@ public static class MainKeyboardShortcuts
             case Key.F12: // Show Avalonia DevTools in DEBUG mode
             case Key.F12: // Show Avalonia DevTools in DEBUG mode
                 return true;
                 return true;
             case Key.F9:
             case Key.F9:
-                _ = FunctionsHelper.ShowStartUpMenu();
+                _ = FunctionsMapper.ShowStartUpMenu();
                 return true;
                 return true;
             case Key.F7:
             case Key.F7:
-                FunctionsHelper.Invalidate();
+                FunctionsMapper.Invalidate();
                 return true;
                 return true;
         }
         }
 #endif
 #endif
@@ -186,7 +186,7 @@ public static class MainKeyboardShortcuts
         // Handle escape key
         // Handle escape key
         if (e.Key == Key.Escape)
         if (e.Key == Key.Escape)
         {
         {
-            await FunctionsHelper.Close().ConfigureAwait(false);
+            await FunctionsMapper.Close().ConfigureAwait(false);
             return true;
             return true;
         }
         }
 
 

+ 2 - 2
src/PicView.Avalonia/Input/MouseShortcuts.cs

@@ -19,11 +19,11 @@ public static class MouseShortcuts
 
 
         if (prop.IsXButton1Pressed)
         if (prop.IsXButton1Pressed)
         {
         {
-            await FunctionsHelper.OpenPreviousFileHistoryEntry().ConfigureAwait(false);
+            await FunctionsMapper.OpenPreviousFileHistoryEntry().ConfigureAwait(false);
         }
         }
         else if (prop.IsXButton2Pressed)
         else if (prop.IsXButton2Pressed)
         {
         {
-            await FunctionsHelper.OpenNextFileHistoryEntry().ConfigureAwait(false);
+            await FunctionsMapper.OpenNextFileHistoryEntry().ConfigureAwait(false);
         }
         }
     }
     }
 }
 }

+ 28 - 31
src/PicView.Avalonia/UI/FunctionsHelper.cs → src/PicView.Avalonia/UI/FunctionsMapper.cs

@@ -1,5 +1,4 @@
-using System.Runtime.InteropServices;
-using Avalonia;
+using Avalonia;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Threading;
 using Avalonia.Threading;
 using PicView.Avalonia.Clipboard;
 using PicView.Avalonia.Clipboard;
@@ -20,7 +19,10 @@ using PicView.Core.ProcessHandling;
 
 
 namespace PicView.Avalonia.UI;
 namespace PicView.Avalonia.UI;
 
 
-public static class FunctionsHelper
+/// <summary>
+/// Used to map functions to their names, used for keyboard shortcuts
+/// </summary>
+public static class FunctionsMapper
 {
 {
     public static MainViewModel? Vm;
     public static MainViewModel? Vm;
 
 
@@ -560,24 +562,31 @@ public static class FunctionsHelper
 
 
     #region Copy and Paste functions
     #region Copy and Paste functions
 
 
+    /// <inheritdoc cref="ClipboardFileOperations.CopyFileToClipboard(string, MainViewModel)" />
     public static async Task CopyFile() =>
     public static async Task CopyFile() =>
         await ClipboardFileOperations.CopyFileToClipboard(Vm?.FileInfo?.FullName, Vm).ConfigureAwait(false);
         await ClipboardFileOperations.CopyFileToClipboard(Vm?.FileInfo?.FullName, Vm).ConfigureAwait(false);
-
+    
+    /// <inheritdoc cref="ClipboardTextOperations.CopyTextToClipboard(string)" />
     public static async Task CopyFilePath() => 
     public static async Task CopyFilePath() => 
         await ClipboardTextOperations.CopyTextToClipboard(Vm?.FileInfo?.FullName).ConfigureAwait(false);
         await ClipboardTextOperations.CopyTextToClipboard(Vm?.FileInfo?.FullName).ConfigureAwait(false);
 
 
+    /// <inheritdoc cref="ClipboardImageOperations.CopyImageToClipboard(MainViewModel)" />
     public static async Task CopyImage() => 
     public static async Task CopyImage() => 
         await ClipboardImageOperations.CopyImageToClipboard(Vm).ConfigureAwait(false);
         await ClipboardImageOperations.CopyImageToClipboard(Vm).ConfigureAwait(false);
 
 
+    /// <inheritdoc cref="ClipboardImageOperations.CopyBase64ToClipboard(string, MainViewModel)" />
     public static async Task CopyBase64() =>
     public static async Task CopyBase64() =>
         await ClipboardImageOperations.CopyBase64ToClipboard(Vm.FileInfo?.FullName, vm: Vm).ConfigureAwait(false);
         await ClipboardImageOperations.CopyBase64ToClipboard(Vm.FileInfo?.FullName, vm: Vm).ConfigureAwait(false);
 
 
+    /// <inheritdoc cref="ClipboardFileOperations.Duplicate(string, MainViewModel)" />
     public static async Task DuplicateFile() => 
     public static async Task DuplicateFile() => 
         await ClipboardFileOperations.Duplicate(Vm.FileInfo?.FullName, Vm).ConfigureAwait(false);
         await ClipboardFileOperations.Duplicate(Vm.FileInfo?.FullName, Vm).ConfigureAwait(false);
 
 
+    /// <inheritdoc cref="ClipboardFileOperations.CutFile(string, MainViewModel)" />
     public static async Task CutFile() =>
     public static async Task CutFile() =>
         await ClipboardFileOperations.CutFile(Vm.FileInfo.FullName, Vm).ConfigureAwait(false);
         await ClipboardFileOperations.CutFile(Vm.FileInfo.FullName, Vm).ConfigureAwait(false);
 
 
+    /// <inheritdoc cref="ClipboardPasteOperations.Paste(MainViewModel)" />
     public static async Task Paste() =>
     public static async Task Paste() =>
         await ClipboardPasteOperations.Paste(Vm).ConfigureAwait(false);
         await ClipboardPasteOperations.Paste(Vm).ConfigureAwait(false);
     
     
@@ -589,30 +598,20 @@ public static class FunctionsHelper
     public static async Task ChangeBackground() =>
     public static async Task ChangeBackground() =>
         await BackgroundManager.ChangeBackgroundAsync(Vm).ConfigureAwait(false);
         await BackgroundManager.ChangeBackgroundAsync(Vm).ConfigureAwait(false);
     
     
-    public static async Task SideBySide()
-    {
-        await SettingsUpdater.ToggleSideBySide(Vm);
-    }
+    /// <inheritdoc cref="SettingsUpdater.ToggleSideBySide(MainViewModel)" />
+    public static async Task SideBySide() =>
+        await SettingsUpdater.ToggleSideBySide(Vm).ConfigureAwait(false);
     
     
-    public static async Task Reload()
-    {
-        if (Vm is null)
-        {
-            return;
-        }
-        await ErrorHandling.ReloadAsync(Vm);
-    }
+    /// <inheritdoc cref="ErrorHandling.ReloadAsync(MainViewModel)" />
+    public static async Task Reload() =>
+        await ErrorHandling.ReloadAsync(Vm).ConfigureAwait(false);
 
 
-    public static Task ResizeImage()
-    {
-        Vm?.PlatformService?.ShowSingleImageResizeWindow();
-        return Task.CompletedTask;
-    }
+    public async static Task ResizeImage() => 
+        await Task.Run(() => Vm?.PlatformService?.ShowSingleImageResizeWindow()).ConfigureAwait(false);
 
 
-    public static async Task Crop()
-    {
+    /// <inheritdoc cref="CropFunctions.StartCropControl(MainViewModel)" />
+    public static async Task Crop() =>
         await Dispatcher.UIThread.InvokeAsync(() => CropFunctions.StartCropControl(Vm));
         await Dispatcher.UIThread.InvokeAsync(() => CropFunctions.StartCropControl(Vm));
-    }
 
 
     public static Task Flip()
     public static Task Flip()
     {
     {
@@ -620,15 +619,13 @@ public static class FunctionsHelper
         return Task.CompletedTask;
         return Task.CompletedTask;
     }
     }
 
 
-    public static async Task OptimizeImage()
-    {
+    /// <inheritdoc cref="ImageOptimizer.OptimizeImageAsync(MainViewModel)" />
+    public static async Task OptimizeImage() =>
         await ImageOptimizer.OptimizeImageAsync(Vm).ConfigureAwait(false);
         await ImageOptimizer.OptimizeImageAsync(Vm).ConfigureAwait(false);
-    }
 
 
-    public static async Task Slideshow()
-    {
-        await Navigation.Slideshow.StartSlideshow(Vm);
-    }
+    /// <inheritdoc cref="Navigation.Slideshow.StartSlideshow(MainViewModel)" />
+    public static async Task Slideshow() =>
+        await Navigation.Slideshow.StartSlideshow(Vm).ConfigureAwait(false);
 
 
     public static Task ColorPicker()
     public static Task ColorPicker()
     {
     {

+ 65 - 65
src/PicView.Avalonia/ViewModels/MainViewModel.cs

@@ -32,7 +32,7 @@ public class MainViewModel : ViewModelBase
 
 
     public MainViewModel(IPlatformSpecificService? platformSpecificService)
     public MainViewModel(IPlatformSpecificService? platformSpecificService)
     {
     {
-        FunctionsHelper.Vm = this;
+        FunctionsMapper.Vm = this;
         PlatformService = platformSpecificService;
         PlatformService = platformSpecificService;
 
 
         #region Window commands
         #region Window commands
@@ -41,7 +41,7 @@ public class MainViewModel : ViewModelBase
         MinimizeCommand = ReactiveCommand.CreateFromTask(WindowFunctions.Minimize);
         MinimizeCommand = ReactiveCommand.CreateFromTask(WindowFunctions.Minimize);
         MaximizeCommand = ReactiveCommand.CreateFromTask(WindowFunctions.MaximizeRestore);
         MaximizeCommand = ReactiveCommand.CreateFromTask(WindowFunctions.MaximizeRestore);
         RestoreCommand = ReactiveCommand.Create(WindowFunctions.Restore);
         RestoreCommand = ReactiveCommand.Create(WindowFunctions.Restore);
-        ToggleFullscreenCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleFullscreen);
+        ToggleFullscreenCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleFullscreen);
         NewWindowCommand = ReactiveCommand.Create(ProcessHelper.StartNewProcess);
         NewWindowCommand = ReactiveCommand.Create(ProcessHelper.StartNewProcess);
 
 
         ShowExifWindowCommand = ReactiveCommand.Create(platformSpecificService.ShowExifWindow);
         ShowExifWindowCommand = ReactiveCommand.Create(platformSpecificService.ShowExifWindow);
@@ -57,81 +57,81 @@ public class MainViewModel : ViewModelBase
 
 
         #region Navigation Commands
         #region Navigation Commands
 
 
-        NextCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsHelper.Next); });
+        NextCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsMapper.Next); });
 
 
         NextButtonCommand = ReactiveCommand.Create(() => { UIHelper.NextButtonNavigation(this); });
         NextButtonCommand = ReactiveCommand.Create(() => { UIHelper.NextButtonNavigation(this); });
 
 
         NextArrowButtonCommand = ReactiveCommand.Create(() => { UIHelper.NextArrowButtonNavigation(this); });
         NextArrowButtonCommand = ReactiveCommand.Create(() => { UIHelper.NextArrowButtonNavigation(this); });
 
 
-        NextFolderCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsHelper.NextFolder); });
+        NextFolderCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsMapper.NextFolder); });
 
 
-        PreviousCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsHelper.Prev); });
+        PreviousCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsMapper.Prev); });
 
 
         PreviousButtonCommand = ReactiveCommand.Create(() => { UIHelper.PreviousButtonNavigation(this); });
         PreviousButtonCommand = ReactiveCommand.Create(() => { UIHelper.PreviousButtonNavigation(this); });
 
 
         PreviousArrowButtonCommand = ReactiveCommand.Create(() => { UIHelper.PreviousArrowButtonNavigation(this); });
         PreviousArrowButtonCommand = ReactiveCommand.Create(() => { UIHelper.PreviousArrowButtonNavigation(this); });
 
 
-        PreviousFolderCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsHelper.PrevFolder); });
+        PreviousFolderCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsMapper.PrevFolder); });
 
 
-        Skip10Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Next10);
+        Skip10Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Next10);
 
 
-        Skip100Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Next100);
+        Skip100Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Next100);
 
 
-        Prev10Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Prev10);
+        Prev10Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Prev10);
 
 
-        Prev100Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Prev100);
+        Prev100Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Prev100);
 
 
-        FirstCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.First);
+        FirstCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.First);
 
 
-        LastCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Last);
+        LastCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Last);
 
 
-        ReloadCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Reload);
+        ReloadCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Reload);
 
 
         #endregion Navigation Commands
         #endregion Navigation Commands
 
 
         #region Sort Commands
         #region Sort Commands
 
 
-        SortFilesByNameCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesByName);
+        SortFilesByNameCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesByName);
 
 
-        SortFilesByCreationTimeCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesByCreationTime);
+        SortFilesByCreationTimeCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesByCreationTime);
 
 
-        SortFilesByLastAccessTimeCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesByLastAccessTime);
+        SortFilesByLastAccessTimeCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesByLastAccessTime);
 
 
-        SortFilesBySizeCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesBySize);
+        SortFilesBySizeCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesBySize);
 
 
-        SortFilesByExtensionCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesByExtension);
+        SortFilesByExtensionCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesByExtension);
 
 
-        SortFilesRandomlyCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesRandomly);
+        SortFilesRandomlyCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesRandomly);
 
 
-        SortFilesAscendingCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesAscending);
+        SortFilesAscendingCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesAscending);
 
 
-        SortFilesDescendingCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SortFilesDescending);
+        SortFilesDescendingCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SortFilesDescending);
 
 
         #endregion Sort Commands
         #endregion Sort Commands
 
 
         #region Menus
         #region Menus
 
 
-        CloseMenuCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.CloseMenus);
+        CloseMenuCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.CloseMenus);
 
 
-        ToggleFileMenuCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleFileMenu);
+        ToggleFileMenuCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleFileMenu);
 
 
-        ToggleImageMenuCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleImageMenu);
+        ToggleImageMenuCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleImageMenu);
 
 
-        ToggleSettingsMenuCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleSettingsMenu);
+        ToggleSettingsMenuCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleSettingsMenu);
 
 
-        ToggleToolsMenuCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleToolsMenu);
+        ToggleToolsMenuCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleToolsMenu);
 
 
         #endregion Menus
         #endregion Menus
 
 
         #region Image commands
         #region Image commands
 
 
-        RotateLeftCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.RotateLeft);
+        RotateLeftCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.RotateLeft);
         RotateLeftButtonCommand = ReactiveCommand.CreateFromTask(async () =>
         RotateLeftButtonCommand = ReactiveCommand.CreateFromTask(async () =>
         {
         {
             await Rotation.RotateLeft(this, Rotation.RotationButton.RotateLeftButton);
             await Rotation.RotateLeft(this, Rotation.RotationButton.RotateLeftButton);
         });
         });
 
 
-        RotateRightCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.RotateRight);
+        RotateRightCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.RotateRight);
         RotateRightButtonCommand = ReactiveCommand.CreateFromTask(async () =>
         RotateRightButtonCommand = ReactiveCommand.CreateFromTask(async () =>
         {
         {
             await Rotation.RotateRight(this, Rotation.RotationButton.RotateRightButton);
             await Rotation.RotateRight(this, Rotation.RotationButton.RotateRightButton);
@@ -142,31 +142,31 @@ public class MainViewModel : ViewModelBase
             await Rotation.RotateRight(this, Rotation.RotationButton.WindowBorderButton);
             await Rotation.RotateRight(this, Rotation.RotationButton.WindowBorderButton);
         });
         });
 
 
-        FlipCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Flip);
+        FlipCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Flip);
 
 
-        StretchCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Stretch);
+        StretchCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Stretch);
 
 
-        CropCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Crop);
+        CropCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Crop);
 
 
-        ToggleScrollCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleScroll);
+        ToggleScrollCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleScroll);
 
 
-        OptimizeImageCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.OptimizeImage);
+        OptimizeImageCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.OptimizeImage);
 
 
-        ChangeBackgroundCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ChangeBackground);
+        ChangeBackgroundCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ChangeBackground);
 
 
-        ShowSideBySideCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SideBySide);
+        ShowSideBySideCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SideBySide);
 
 
         #endregion Image commands
         #endregion Image commands
 
 
         #region File commands
         #region File commands
 
 
-        OpenFileCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsHelper.Open); });
+        OpenFileCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsMapper.Open); });
 
 
-        OpenLastFileCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsHelper.OpenLastFile); });
+        OpenLastFileCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsMapper.OpenLastFile); });
 
 
-        SaveFileCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Save);
+        SaveFileCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Save);
 
 
-        SaveFileAsCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SaveAs);
+        SaveFileAsCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SaveAs);
 
 
         CopyFileCommand = ReactiveCommand.CreateFromTask<string>(CopyFileTask);
         CopyFileCommand = ReactiveCommand.CreateFromTask<string>(CopyFileTask);
 
 
@@ -174,17 +174,17 @@ public class MainViewModel : ViewModelBase
 
 
         FilePropertiesCommand = ReactiveCommand.CreateFromTask<string>(ShowFilePropertiesTask);
         FilePropertiesCommand = ReactiveCommand.CreateFromTask<string>(ShowFilePropertiesTask);
 
 
-        CopyImageCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.CopyImage);
+        CopyImageCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.CopyImage);
 
 
         CopyBase64Command = ReactiveCommand.CreateFromTask<string>(CopyBase64Task);
         CopyBase64Command = ReactiveCommand.CreateFromTask<string>(CopyBase64Task);
 
 
         CutCommand = ReactiveCommand.CreateFromTask<string>(CutFileTask);
         CutCommand = ReactiveCommand.CreateFromTask<string>(CutFileTask);
 
 
-        PasteCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsHelper.Paste); });
+        PasteCommand = ReactiveCommand.Create(() => { Task.Run(FunctionsMapper.Paste); });
 
 
         OpenWithCommand = ReactiveCommand.CreateFromTask<string>(OpenWithTask);
         OpenWithCommand = ReactiveCommand.CreateFromTask<string>(OpenWithTask);
 
 
-        RenameCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Rename);
+        RenameCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Rename);
 
 
         ResizeCommand = ReactiveCommand.CreateFromTask<int>(ResizeImageByPercentage);
         ResizeCommand = ReactiveCommand.CreateFromTask<int>(ResizeImageByPercentage);
         ConvertCommand = ReactiveCommand.CreateFromTask<int>(ConvertFileExtension);
         ConvertCommand = ReactiveCommand.CreateFromTask<int>(ConvertFileExtension);
@@ -211,25 +211,25 @@ public class MainViewModel : ViewModelBase
 
 
         #region EXIF commands
         #region EXIF commands
 
 
-        SetExifRating0Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Set0Star);
-        SetExifRating1Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Set1Star);
-        SetExifRating2Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Set2Star);
-        SetExifRating3Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Set3Star);
-        SetExifRating4Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Set4Star);
-        SetExifRating5Command = ReactiveCommand.CreateFromTask(FunctionsHelper.Set5Star);
+        SetExifRating0Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Set0Star);
+        SetExifRating1Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Set1Star);
+        SetExifRating2Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Set2Star);
+        SetExifRating3Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Set3Star);
+        SetExifRating4Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Set4Star);
+        SetExifRating5Command = ReactiveCommand.CreateFromTask(FunctionsMapper.Set5Star);
 
 
-        OpenGoogleLinkCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.OpenGoogleMaps);
-        OpenBingLinkCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.OpenBingMaps);
+        OpenGoogleLinkCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.OpenGoogleMaps);
+        OpenBingLinkCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.OpenBingMaps);
 
 
         #endregion EXIF commands
         #endregion EXIF commands
 
 
         #region Gallery Commands
         #region Gallery Commands
 
 
-        ToggleGalleryCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleGallery);
+        ToggleGalleryCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleGallery);
 
 
-        ToggleBottomGalleryCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.OpenCloseBottomGallery);
+        ToggleBottomGalleryCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.OpenCloseBottomGallery);
 
 
-        CloseGalleryCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.CloseGallery);
+        CloseGalleryCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.CloseGallery);
 
 
         GalleryItemStretchCommand = ReactiveCommand.Create<string>(SetGalleryItemStretch);
         GalleryItemStretchCommand = ReactiveCommand.Create<string>(SetGalleryItemStretch);
 
 
@@ -237,9 +237,9 @@ public class MainViewModel : ViewModelBase
 
 
         #region UI Commands
         #region UI Commands
 
 
-        ToggleUICommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleInterface);
+        ToggleUICommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleInterface);
 
 
-        ToggleBottomNavBarCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleBottomToolbar);
+        ToggleBottomNavBarCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleBottomToolbar);
 
 
         ToggleBottomGalleryShownInHiddenUICommand = ReactiveCommand.CreateFromTask(async () =>
         ToggleBottomGalleryShownInHiddenUICommand = ReactiveCommand.CreateFromTask(async () =>
         {
         {
@@ -251,31 +251,31 @@ public class MainViewModel : ViewModelBase
             await HideInterfaceLogic.ToggleFadeInButtonsOnHover(this);
             await HideInterfaceLogic.ToggleFadeInButtonsOnHover(this);
         });
         });
 
 
-        ChangeCtrlZoomCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ChangeCtrlZoom);
+        ChangeCtrlZoomCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ChangeCtrlZoom);
 
 
-        ColorPickerCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ColorPicker);
+        ColorPickerCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ColorPicker);
 
 
         SlideshowCommand = ReactiveCommand.CreateFromTask<int>(StartSlideShowTask);
         SlideshowCommand = ReactiveCommand.CreateFromTask<int>(StartSlideShowTask);
 
 
-        ToggleTaskbarProgressCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleTaskbarProgress);
+        ToggleTaskbarProgressCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleTaskbarProgress);
 
 
         #endregion UI Commands
         #endregion UI Commands
 
 
         #region Settings commands
         #region Settings commands
 
 
-        ChangeAutoFitCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.AutoFitWindow);
+        ChangeAutoFitCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.AutoFitWindow);
 
 
-        ChangeTopMostCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.SetTopMost);
+        ChangeTopMostCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.SetTopMost);
 
 
-        ToggleSubdirectoriesCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleSubdirectories);
+        ToggleSubdirectoriesCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleSubdirectories);
 
 
-        ToggleLoopingCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleLooping);
+        ToggleLoopingCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleLooping);
 
 
-        ResetSettingsCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ResetSettings);
+        ResetSettingsCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ResetSettings);
 
 
-        RestartCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.Restart);
+        RestartCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.Restart);
 
 
-        ToggleUsingTouchpadCommand = ReactiveCommand.CreateFromTask(FunctionsHelper.ToggleUsingTouchpad);
+        ToggleUsingTouchpadCommand = ReactiveCommand.CreateFromTask(FunctionsMapper.ToggleUsingTouchpad);
 
 
         #endregion Settings commands
         #endregion Settings commands
     }
     }

+ 1 - 1
src/PicView.Avalonia/Views/KeybindingsView.axaml.cs

@@ -54,6 +54,6 @@ public partial class KeybindingsView : UserControl
             window.Close();
             window.Close();
         });
         });
 
 
-        await FunctionsHelper.KeybindingsWindow();
+        await FunctionsMapper.KeybindingsWindow();
     }
     }
 }
 }