diff --git a/RainmeterEditor/Resources/Strings.Designer.cs b/RainmeterEditor/Resources/Strings.Designer.cs index 986ee145..ea6d64cd 100644 --- a/RainmeterEditor/Resources/Strings.Designer.cs +++ b/RainmeterEditor/Resources/Strings.Designer.cs @@ -70,7 +70,7 @@ namespace RainmeterEditor.Resources { } /// - /// Looks up a localized string similar to New file.... + /// Looks up a localized string similar to _File.... /// internal static string DocumentCreateCommand_DisplayText { get { diff --git a/RainmeterEditor/Resources/Strings.resx b/RainmeterEditor/Resources/Strings.resx index ca250b3d..e2d125c1 100644 --- a/RainmeterEditor/Resources/Strings.resx +++ b/RainmeterEditor/Resources/Strings.resx @@ -121,7 +121,7 @@ Utility - New file... + _File... Creates a new file diff --git a/RainmeterEditor/UI/MainWindow.xaml b/RainmeterEditor/UI/MainWindow.xaml index 8f1b80c6..e5601ce8 100644 --- a/RainmeterEditor/UI/MainWindow.xaml +++ b/RainmeterEditor/UI/MainWindow.xaml @@ -27,17 +27,14 @@ - - + - + @@ -62,6 +59,10 @@ + diff --git a/RainmeterEditor/UI/MainWindow.xaml.cs b/RainmeterEditor/UI/MainWindow.xaml.cs index bb318c4f..67c34f81 100644 --- a/RainmeterEditor/UI/MainWindow.xaml.cs +++ b/RainmeterEditor/UI/MainWindow.xaml.cs @@ -24,29 +24,24 @@ namespace RainmeterEditor.UI { private DocumentController documentController; - private IEnumerable Commands - { - get - { - yield return documentController.DocumentCreateCommand; - } - } + public Command DocumentCreateCommand { get { return documentController.DocumentCreateCommand; } } public MainWindow() { InitializeComponent(); + this.DataContext = this; + documentController = new DocumentController(); documentController.OwnerWindow = this; documentController.DocumentOpened += documentController_DocumentOpened; + AddKeyBinding(documentController.DocumentCreateCommand); + } - foreach (var c in Commands) - { - Resources.Add(c.Name, c); - - if (c.Shortcut != null) - InputBindings.Add(new KeyBinding(c, c.Shortcut)); - } + private void AddKeyBinding(Command c) + { + if (c.Shortcut != null) + InputBindings.Add(new KeyBinding(c, c.Shortcut)); } void documentController_DocumentOpened(object sender, DocumentOpenedEventArgs e)