Shortcuts für Save, SaveAll, Reload und Validate

This commit is contained in:
Daniel Schick 2022-07-15 08:46:38 +02:00
parent 9d70c2a482
commit 6138c99ba9
2 changed files with 32 additions and 4 deletions

View File

@ -14,6 +14,7 @@ using ENI2.DetailViewControls;
using ENI2.Util;
using ENI2.EditControls;
using System.Windows.Input;
namespace ENI2
{
@ -143,6 +144,23 @@ namespace ENI2
BindingOperations.EnableCollectionSynchronization(_messages, this.messageListLock);
Dispatcher.BeginInvoke((Action)(() => this.listBoxMessages.SelectedIndex = 0));
RoutedCommand saveCmd = new RoutedCommand();
saveCmd.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(saveCmd, this.buttonSave_Click));
RoutedCommand saveAllCmd = new RoutedCommand();
saveAllCmd.InputGestures.Add(new KeyGesture(Key.A, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(saveAllCmd, this.buttonSaveAll_Click));
RoutedCommand reloadCmd = new RoutedCommand();
reloadCmd.InputGestures.Add(new KeyGesture(Key.R, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(reloadCmd, this.ShortCutReload));
RoutedCommand validateCmd = new RoutedCommand();
validateCmd.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(validateCmd, this.ShortCutValidate));
}
#endregion
@ -541,6 +559,16 @@ namespace ENI2
}
*/
private void ShortCutReload(object sender, ExecutedRoutedEventArgs e)
{
this.DetailControl_RequestReload(this.Core.Id.Value);
}
private void ShortCutValidate(object sender, ExecutedRoutedEventArgs e)
{
this.DetailControl_RequestValidate();
}
private void DetailControl_RequestReload(Guid id)
{
/// core und messages neu laden