Forráskód Böngészése

Moved ShortcutController in Controllers Namespace and fixed shortcuts popup

CPKreuz 3 éve
szülő
commit
73cbe2b174

+ 1 - 1
PixiEditor/Helpers/Behaviours/ClearFocusOnClickBehavior.cs

@@ -1,4 +1,4 @@
-using PixiEditor.Models.Controllers.Shortcuts;
+using PixiEditor.Models.Controllers;
 using System.Windows;
 using System.Windows.Input;
 using System.Windows.Interactivity;

+ 1 - 1
PixiEditor/Helpers/Behaviours/GlobalShortcutFocusBehavior.cs

@@ -5,7 +5,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Interactivity;
-using PixiEditor.Models.Controllers.Shortcuts;
+using PixiEditor.Models.Controllers;
 
 namespace PixiEditor.Helpers.Behaviours
 {

+ 11 - 4
PixiEditor/Helpers/Converters/EqualityBoolToVisibilityConverter.cs

@@ -1,5 +1,4 @@
-using System;
-using System.Globalization;
+using System.Globalization;
 using System.Windows;
 
 namespace PixiEditor.Helpers.Converters
@@ -13,8 +12,16 @@ namespace PixiEditor.Helpers.Converters
             if (value == null)
                 return Invert;
 
-            var parameterValue = System.Convert.ChangeType(parameter, value.GetType());
-            return value.Equals(parameterValue) != Invert ? Visibility.Visible : Visibility.Collapsed;
+            if (value.GetType().IsAssignableTo(typeof(Enum)) && parameter is string s)
+            {
+                parameter = Enum.Parse(value.GetType(), s);
+            }
+            else
+            {
+                parameter = System.Convert.ChangeType(parameter, value.GetType());
+            }
+
+            return value.Equals(parameter) != Invert ? Visibility.Visible : Visibility.Collapsed;
         }
     }
 }

+ 32 - 0
PixiEditor/Helpers/Converters/ModifierFlagToModifiersConverter.cs

@@ -0,0 +1,32 @@
+using System.Globalization;
+using System.Windows.Input;
+
+namespace PixiEditor.Helpers.Converters;
+
+public class ModifierFlagToModifiersConverter : SingleInstanceConverter<ModifierFlagToModifiersConverter>
+{
+    public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+    {
+        return GetModifiers((ModifierKeys)value);
+    }
+    
+    private IEnumerable<ModifierKeys> GetModifiers(ModifierKeys keys)
+    {
+        if (keys.HasFlag(ModifierKeys.Windows))
+        {
+            yield return ModifierKeys.Windows;
+        }
+        else if (keys.HasFlag(ModifierKeys.Control))
+        {
+            yield return ModifierKeys.Control;
+        }
+        else if (keys.HasFlag(ModifierKeys.Shift))
+        {
+            yield return ModifierKeys.Shift;
+        }
+        else if (keys.HasFlag(ModifierKeys.Alt))
+        {
+            yield return ModifierKeys.Alt;
+        }
+    }
+}

+ 0 - 1
PixiEditor/Helpers/Extensions/ServiceCollectionHelpers.cs

@@ -1,7 +1,6 @@
 using Microsoft.Extensions.DependencyInjection;
 using PixiEditor.Models.Commands;
 using PixiEditor.Models.Controllers;
-using PixiEditor.Models.Controllers.Shortcuts;
 using PixiEditor.Models.Services;
 using PixiEditor.Models.Tools;
 using PixiEditor.Models.Tools.Tools;

+ 0 - 2
PixiEditor/Models/Commands/CommandController.cs

@@ -42,8 +42,6 @@ namespace PixiEditor.Models.Commands
             FactoryEvaluators = new();
             CanExecuteEvaluators = new();
             IconEvaluators = new();
-
-            Init(services);
         }
 
         public void Init(IServiceProvider services)

+ 29 - 1
PixiEditor/Models/Commands/CommandGroup.cs

@@ -1,4 +1,6 @@
-using System.Collections;
+using PixiEditor.Models.DataHolders;
+using System.Collections;
+using System.Windows.Input;
 
 namespace PixiEditor.Models.Commands
 {
@@ -9,6 +11,8 @@ namespace PixiEditor.Models.Commands
 
         public string Display { get; set; }
 
+        public bool HasAssignedShortcuts { get; set; }
+
         public IEnumerable<Command> Commands => commands;
 
         public IEnumerable<Command> VisibleCommands => visibleCommands;
@@ -18,6 +22,30 @@ namespace PixiEditor.Models.Commands
             Display = display;
             this.commands = commands.ToArray();
             visibleCommands = commands.Where(x => !string.IsNullOrEmpty(x.Display)).ToArray();
+
+            foreach (var command in commands)
+            {
+                HasAssignedShortcuts |= command.Shortcut.Key != Key.None;
+                command.ShortcutChanged += Command_ShortcutChanged;
+            }
+        }
+
+        private void Command_ShortcutChanged(Command _, ShortcutChangedEventArgs args)
+        {
+            if ((args.NewShortcut != KeyCombination.None && HasAssignedShortcuts) ||
+                (args.NewShortcut == KeyCombination.None && !HasAssignedShortcuts))
+            {
+                // If a shortcut is already assigned and the new shortcut is not none nothing can change
+                // If no shortcut is already assigned and the new shortcut is none nothing can change
+                return;
+            }
+
+            HasAssignedShortcuts = false;
+
+            foreach (var command in commands)
+            {
+                HasAssignedShortcuts |= command.Shortcut.Key != Key.None;
+            }
         }
 
         public IEnumerator<Command> GetEnumerator() => Commands.GetEnumerator();

+ 11 - 1
PixiEditor/Models/Commands/Commands/Command.cs

@@ -30,9 +30,17 @@ namespace PixiEditor.Models.Commands
         public KeyCombination Shortcut
         {
             get => _shortcut;
-            set => SetProperty(ref _shortcut, value);
+            set
+            {
+                if (SetProperty(ref _shortcut, value, out var oldValue))
+                {
+                    ShortcutChanged?.Invoke(this, new(oldValue, value));
+                }
+            }
         }
 
+        public event ShortcutChangedEventHandler ShortcutChanged;
+        
         protected abstract object GetParameter();
 
         protected Command(Action<object> onExecute, CanExecuteEvaluator canExecute) =>
@@ -43,5 +51,7 @@ namespace PixiEditor.Models.Commands
         public bool CanExecute() => Methods.CanExecute(GetParameter());
 
         public ImageSource GetIcon() => IconEvaluator.EvaluateEvaluator(this, GetParameter());
+        
+        public delegate void ShortcutChangedEventHandler(Command command, ShortcutChangedEventArgs args);
     }
 }

+ 16 - 0
PixiEditor/Models/Commands/ShortcutChangedEventArgs.cs

@@ -0,0 +1,16 @@
+using PixiEditor.Models.DataHolders;
+
+namespace PixiEditor.Models.Commands;
+
+public class ShortcutChangedEventArgs : EventArgs
+{
+    public KeyCombination OldShortcut { get; }
+    
+    public KeyCombination NewShortcut { get; }
+    
+    public ShortcutChangedEventArgs(KeyCombination oldShortcut, KeyCombination newShortcut)
+    {
+        OldShortcut = oldShortcut;
+        NewShortcut = newShortcut;
+    }
+}

+ 67 - 67
PixiEditor/Models/Controllers/Shortcuts/ShortcutController.cs → PixiEditor/Models/Controllers/ShortcutController.cs

@@ -1,67 +1,67 @@
-using PixiEditor.Models.Commands;
-using PixiEditor.Models.DataHolders;
-using PixiEditor.Models.Tools;
-using System.Windows.Input;
-
-namespace PixiEditor.Models.Controllers.Shortcuts
-{
-    public class ShortcutController
-    {
-        public static bool ShortcutExecutionBlocked => _shortcutExecutionBlockers.Count > 0;
-
-        private static readonly List<string> _shortcutExecutionBlockers = new List<string>();
-
-        public IEnumerable<Command> LastCommands { get; private set; }
-
-        public Dictionary<KeyCombination, Tool> TransientShortcuts { get; set; } = new();
-
-        public static void BlockShortcutExection(string blocker)
-        {
-            if (_shortcutExecutionBlockers.Contains(blocker)) return;
-            _shortcutExecutionBlockers.Add(blocker);
-        }
-
-        public static void UnblockShortcutExecution(string blocker)
-        {
-            if (!_shortcutExecutionBlockers.Contains(blocker)) return;
-            _shortcutExecutionBlockers.Remove(blocker);
-        }
-
-        public static void UnblockShortcutExecutionAll()
-        {
-            _shortcutExecutionBlockers.Clear();
-        }
-
-        public KeyCombination GetToolShortcut<T>()
-        {
-            return GetToolShortcut(typeof(T));
-        }
-
-        public KeyCombination GetToolShortcut(Type type)
-        {
-            return CommandController.Current.Commands.First(x => x is Command.ToolCommand tool && tool.ToolType == type).Shortcut;
-        }
-
-        public void KeyPressed(Key key, ModifierKeys modifiers)
-        {
-            KeyCombination shortcut = new(key, modifiers);
-
-            if (!ShortcutExecutionBlocked)
-            {
-                var commands = CommandController.Current.Commands[shortcut];
-
-                if (!commands.Any())
-                {
-                    return;
-                }
-
-                LastCommands = commands;
-
-                foreach (var command in CommandController.Current.Commands[shortcut])
-                {
-                    command.Execute();
-                }
-            }
-        }
-    }
-}
+using PixiEditor.Models.Commands;
+using PixiEditor.Models.DataHolders;
+using PixiEditor.Models.Tools;
+using System.Windows.Input;
+
+namespace PixiEditor.Models.Controllers
+{
+    public class ShortcutController
+    {
+        public static bool ShortcutExecutionBlocked => _shortcutExecutionBlockers.Count > 0;
+
+        private static readonly List<string> _shortcutExecutionBlockers = new List<string>();
+
+        public IEnumerable<Command> LastCommands { get; private set; }
+
+        public Dictionary<KeyCombination, Tool> TransientShortcuts { get; set; } = new();
+
+        public static void BlockShortcutExection(string blocker)
+        {
+            if (_shortcutExecutionBlockers.Contains(blocker)) return;
+            _shortcutExecutionBlockers.Add(blocker);
+        }
+
+        public static void UnblockShortcutExecution(string blocker)
+        {
+            if (!_shortcutExecutionBlockers.Contains(blocker)) return;
+            _shortcutExecutionBlockers.Remove(blocker);
+        }
+
+        public static void UnblockShortcutExecutionAll()
+        {
+            _shortcutExecutionBlockers.Clear();
+        }
+
+        public KeyCombination GetToolShortcut<T>()
+        {
+            return GetToolShortcut(typeof(T));
+        }
+
+        public KeyCombination GetToolShortcut(Type type)
+        {
+            return CommandController.Current.Commands.First(x => x is Command.ToolCommand tool && tool.ToolType == type).Shortcut;
+        }
+
+        public void KeyPressed(Key key, ModifierKeys modifiers)
+        {
+            KeyCombination shortcut = new(key, modifiers);
+
+            if (!ShortcutExecutionBlocked)
+            {
+                var commands = CommandController.Current.Commands[shortcut];
+
+                if (!commands.Any())
+                {
+                    return;
+                }
+
+                LastCommands = commands;
+
+                foreach (var command in CommandController.Current.Commands[shortcut])
+                {
+                    command.Execute();
+                }
+            }
+        }
+    }
+}

+ 0 - 46
PixiEditor/Models/Controllers/Shortcuts/Shortcut.cs

@@ -1,46 +0,0 @@
-using System.Linq;
-using System.Windows.Input;
-using PixiEditor.Helpers.Extensions;
-
-namespace PixiEditor.Models.Controllers.Shortcuts
-{
-    public class Shortcut
-    {
-        public Shortcut(Key shortcutKey, ICommand command, object commandParameter = null, ModifierKeys modifier = ModifierKeys.None)
-        {
-            ShortcutKey = shortcutKey;
-            Modifier = modifier;
-            Command = command;
-            CommandParameter = commandParameter;
-        }
-
-        public Shortcut(Key shortcutKey, ICommand command, string description, object commandParameter = null, ModifierKeys modifier = ModifierKeys.None)
-            : this(shortcutKey, command, commandParameter, modifier)
-        {
-            Description = description;
-        }
-
-        public Key ShortcutKey { get; set; }
-
-        public ModifierKeys Modifier { get; set; }
-
-        /// <summary>
-        /// Gets all <see cref="ModifierKeys"/> as an array.
-        /// </summary>
-        public ModifierKeys[] Modifiers { get => Modifier.GetFlags().Except(new ModifierKeys[] { ModifierKeys.None }).ToArray(); }
-
-        public ICommand Command { get; set; }
-
-        public string Description { get; set; }
-
-        public object CommandParameter { get; set; }
-
-        public void Execute()
-        {
-            if (Command.CanExecute(CommandParameter))
-            {
-                Command.Execute(CommandParameter);
-            }
-        }
-    }
-}

+ 0 - 43
PixiEditor/Models/Controllers/Shortcuts/ShortcutGroup.cs

@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PixiEditor.Models.Controllers.Shortcuts
-{
-    public class ShortcutGroup
-    {
-        /// <summary>
-        /// Gets or sets the shortcuts in the shortcuts group.
-        /// </summary>
-        public ObservableCollection<Shortcut> Shortcuts { get; set; }
-
-        /// <summary>
-        /// Gets or sets the name of the shortcut group.
-        /// </summary>
-        public string Name { get; set; }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether gets or sets the shortcut group visible in the shortcut popup.
-        /// </summary>
-        public bool IsVisible { get; set; }
-
-        public ShortcutGroup(string name, params Shortcut[] shortcuts)
-        {
-            Name = name;
-            Shortcuts = new ObservableCollection<Shortcut>(shortcuts);
-            IsVisible = true;
-        }
-
-        /// <param name="name">The name of the group.</param>
-        /// <param name="shortcuts">The shortcuts that belong in the group.</param>
-        /// <param name="isVisible">Is the group visible in the shortcut popup.</param>
-        public ShortcutGroup(string name, bool isVisible = true, params Shortcut[] shortcuts)
-            : this(name, shortcuts)
-        {
-            IsVisible = isVisible;
-        }
-    }
-}

+ 0 - 1
PixiEditor/ViewModels/SubViewModels/Main/IoViewModel.cs

@@ -1,7 +1,6 @@
 using PixiEditor.Helpers;
 using PixiEditor.Models.Commands;
 using PixiEditor.Models.Controllers;
-using PixiEditor.Models.Controllers.Shortcuts;
 using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.Tools;
 using PixiEditor.Models.Tools.Tools;

+ 2 - 2
PixiEditor/ViewModels/SubViewModels/Main/ToolsViewModel.cs

@@ -178,8 +178,8 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             }
         }
 
-        [Command.Basic("PixiEditor.Tools.IncreaseSize", 1, "Increase Tool Size", "Increase Tool Size")]
-        [Command.Basic("PixiEditor.Tools.DecreaseSize", -1, "Decrease Tool Size", "Increase Tool Size")]
+        [Command.Basic("PixiEditor.Tools.IncreaseSize", 1, "Increase Tool Size", "Increase Tool Size", Key = Key.OemCloseBrackets)]
+        [Command.Basic("PixiEditor.Tools.DecreaseSize", -1, "Decrease Tool Size", "Decrease Tool Size", Key = Key.OemOpenBrackets)]
         public void ChangeToolSize(int increment)
         {
             int newSize = ToolSize + increment;

+ 17 - 8
PixiEditor/ViewModels/SubViewModels/Main/WindowViewModel.cs

@@ -1,24 +1,26 @@
-using AvalonDock.Layout;
+using System.Windows.Input;
+using AvalonDock.Layout;
 using GalaSoft.MvvmLight.CommandWpf;
-using PixiEditor.Models.Commands.Attributes;
+using PixiEditor.Models.Commands;
 using PixiEditor.Views.Dialogs;
+using Command = PixiEditor.Models.Commands.Attributes.Command;
 
 namespace PixiEditor.ViewModels.SubViewModels.Main
 {
     [Command.Group("PixiEditor.Window", "Windows")]
     public class WindowViewModel : SubViewModel<ViewModelMain>
     {
+        private ShortcutPopup shortcutPopup;
+        
         public RelayCommand<string> ShowAvalonDockWindowCommand { get; set; }
 
-        public WindowViewModel()
-            : this(null)
-        {
-        }
-
-        public WindowViewModel(ViewModelMain owner)
+        
+        
+        public WindowViewModel(ViewModelMain owner, CommandController commandController)
             : base(owner)
         {
             ShowAvalonDockWindowCommand = new(ShowAvalonDockWindow);
+            shortcutPopup = new(commandController);
         }
 
         [Command.Basic("PixiEditor.Window.OpenSettingsWindow", "Open Settings", "Open Settings Window")]
@@ -34,6 +36,13 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             new HelloTherePopup(Owner.FileSubViewModel).Show();
         }
 
+        [Command.Basic("PixiEditor.Window.OpenShortcutWindow", "Open Shortcut Window", "Open Shortcut Window", Key = Key.F1)]
+        public void ShowShortcutWindow()
+        {
+            shortcutPopup.Show();
+            shortcutPopup.Activate();
+        }
+        
         [Command.Basic("PixiEditor.Window.OpenNavigationWindow", "navigation", "Open Navigation Window", "Open Navigation Window")]
         public static void ShowAvalonDockWindow(string id)
         {

+ 1 - 1
PixiEditor/ViewModels/ViewModelMain.cs

@@ -10,7 +10,6 @@ using Microsoft.Extensions.DependencyInjection;
 using PixiEditor.Helpers;
 using PixiEditor.Models.Commands;
 using PixiEditor.Models.Controllers;
-using PixiEditor.Models.Controllers.Shortcuts;
 using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.Dialogs;
 using PixiEditor.Models.Enums;
@@ -158,6 +157,7 @@ namespace PixiEditor.ViewModels
             BitmapManager.PrimaryColor = ColorsSubViewModel.PrimaryColor;
 
             CommandController = services.GetService<CommandController>();
+            CommandController.Init(services);
             ShortcutController = new ShortcutController();
 
             ToolsSubViewModel?.SetupToolsTooltipShortcuts(services);

+ 14 - 12
PixiEditor/Views/Dialogs/ShortcutPopup.xaml

@@ -6,10 +6,11 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
-        xmlns:shortcuts="clr-namespace:PixiEditor.Models.Controllers.Shortcuts" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls"
+        xmlns:commands="clr-namespace:PixiEditor.Models.Commands"
+        xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls"
         mc:Ignorable="d"
         WindowStartupLocation="CenterScreen"
-        Title="ShortcutPopup" Height="770" Width="620" WindowStyle="None"
+        Title="ShortcutPopup" Height="740" Width="1220" WindowStyle="None"
         MinHeight="770" MinWidth="620" Topmost="{Binding IsTopmost}">
     <Window.Resources>
         <BoolToVisibilityConverter x:Key="BoolToVisibility"/>
@@ -76,16 +77,17 @@
 
         <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
             <WrapPanel HorizontalAlignment="Center">
-                <ItemsControl ItemsSource="{Binding Controller.ShortcutGroups}" Background="Transparent">
+                <ItemsControl ItemsSource="{Binding Controller.CommandGroups}" Background="Transparent">
                     <ItemsControl.ItemTemplate>
-                        <DataTemplate DataType="{x:Type shortcuts:ShortcutGroup}">
-                            <StackPanel Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibility}}">
-                                <TextBlock Text="{Binding Name}" Foreground="White" FontSize="15" FontWeight="Medium" Margin="10,8,0,5"/>
-                                <ItemsControl ItemsSource="{Binding Shortcuts}">
+                        <DataTemplate DataType="{x:Type commands:CommandGroup}">
+                            <StackPanel Visibility="{Binding HasAssignedShortcuts, Converter={StaticResource BoolToVisibility}}">
+                                <TextBlock Text="{Binding Display}" Foreground="White" FontSize="15" FontWeight="Medium" Margin="10,8,0,5"/>
+                                <ItemsControl ItemsSource="{Binding VisibleCommands}">
                                     <ItemsControl.ItemTemplate>
-                                        <DataTemplate DataType="{x:Type shortcuts:Shortcut}">
-                                            <StackPanel Orientation="Horizontal" Margin="20,0,0,0">
-                                                <ItemsControl ItemsSource="{Binding Modifiers}">
+                                        <DataTemplate DataType="{x:Type commands:Command}">
+                                            <StackPanel Orientation="Horizontal" Margin="20,0,0,0" Visibility="{Binding Shortcut.Key, ConverterParameter=None, Converter={converters:EqualityBoolToVisibilityConverter Invert=True}}"
+                                                        ToolTip="{Binding Description}">
+                                                <ItemsControl ItemsSource="{Binding Shortcut.Modifiers, Converter={converters:ModifierFlagToModifiersConverter}}">
                                                     <ItemsControl.ItemTemplate>
                                                         <DataTemplate DataType="{x:Type ModifierKeys}">
                                                             <Border Style="{StaticResource KeyBorder}">
@@ -100,10 +102,10 @@
                                                     </ItemsControl.ItemsPanel>
                                                 </ItemsControl>
                                                 <Border Style="{StaticResource KeyBorderLast}">
-                                                    <TextBlock Text="{Binding ShortcutKey, Converter={converters:KeyToStringConverter}}" Style="{StaticResource KeyBorderText}"/>
+                                                    <TextBlock Text="{Binding Shortcut.Key, Converter={converters:KeyToStringConverter}}" Style="{StaticResource KeyBorderText}"/>
                                                 </Border>
 
-                                                <TextBlock Text="{Binding Description}" Foreground="#FFEEEEEE" VerticalAlignment="Center" FontSize="14" Margin="8,0,0,0"/>
+                                                <TextBlock Text="{Binding Display}" Foreground="#FFEEEEEE" VerticalAlignment="Center" FontSize="14" Margin="8,0,0,0"/>
                                             </StackPanel>
                                         </DataTemplate>
                                     </ItemsControl.ItemTemplate>

+ 9 - 4
PixiEditor/Views/Dialogs/ShortcutPopup.xaml.cs

@@ -1,7 +1,8 @@
-using PixiEditor.Models.Controllers.Shortcuts;
+using PixiEditor.Models.Commands;
 using System.ComponentModel;
 using System.Windows;
 using System.Windows.Input;
+using PixiEditor.Models.DataHolders;
 
 namespace PixiEditor.Views.Dialogs
 {
@@ -11,16 +12,20 @@ namespace PixiEditor.Views.Dialogs
     public partial class ShortcutPopup : Window
     {
         public static readonly DependencyProperty ControllerProperty =
-            DependencyProperty.Register(nameof(Controller), typeof(ShortcutController), typeof(ShortcutPopup));
+            DependencyProperty.Register(nameof(Controller), typeof(CommandController), typeof(ShortcutPopup));
 
-        public ShortcutController Controller { get => (ShortcutController)GetValue(ControllerProperty); set => SetValue(ControllerProperty, value); }
+        public CommandController Controller
+        {
+            get => (CommandController)GetValue(ControllerProperty);
+            set => SetValue(ControllerProperty, value);
+        }
 
         public static readonly DependencyProperty IsTopmostProperty =
             DependencyProperty.Register(nameof(IsTopmost), typeof(bool), typeof(ShortcutPopup));
 
         public bool IsTopmost { get => (bool)GetValue(IsTopmostProperty); set => SetValue(IsTopmostProperty, value); }
 
-        public ShortcutPopup(ShortcutController controller)
+        public ShortcutPopup(CommandController controller)
         {
             DataContext = this;
             InitializeComponent();

+ 1 - 0
PixiEditor/Views/MainWindow.xaml

@@ -150,6 +150,7 @@
                               IsCheckable="True" InputGestureText="{cmds:ShortcutBinding PixiEditor.View.ToggleGrid}"/>
                         <MenuItem Header="Open _Startup Window" ToolTip="Hello there!" cmds:Menu.Command="PixiEditor.Window.OpenStartupWindow"/>
                         <MenuItem Header="Open _Navigation Window" cmds:Menu.Command="PixiEditor.Window.OpenNavigationWindow"/>
+                        <MenuItem Header="Open _Shortcuts Window" cmds:Menu.Command="PixiEditor.Window.OpenShortcutWindow"/>
                     </MenuItem>
                     <MenuItem Header="_Help">
                         <MenuItem Header="_Documentation" cmds:Menu.Command="PixiEditor.Links.OpenDocumentation" />

+ 0 - 1
PixiEditor/Views/UserControls/EditableTextBlock.xaml.cs

@@ -4,7 +4,6 @@ using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Threading;
 using PixiEditor.Models.Controllers;
-using PixiEditor.Models.Controllers.Shortcuts;
 
 namespace PixiEditor.Views
 {

+ 0 - 1
PixiEditor/Views/UserControls/Layers/LayersManager.xaml.cs

@@ -1,5 +1,4 @@
 using PixiEditor.Models.Controllers;
-using PixiEditor.Models.Controllers.Shortcuts;
 using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.Layers;
 using PixiEditor.Models.Undo;