|
@@ -12,6 +12,8 @@ internal class ShortcutBinding : MarkupExtension
|
|
|
|
|
|
public string Name { get; set; }
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
+ public IValueConverter Converter { get; set; }
|
|
|
|
+
|
|
public ShortcutBinding() { }
|
|
public ShortcutBinding() { }
|
|
|
|
|
|
public ShortcutBinding(string name) => Name = name;
|
|
public ShortcutBinding(string name) => Name = name;
|
|
@@ -25,14 +27,15 @@ internal class ShortcutBinding : MarkupExtension
|
|
}
|
|
}
|
|
|
|
|
|
commandController ??= ViewModelMain.Current.CommandController;
|
|
commandController ??= ViewModelMain.Current.CommandController;
|
|
- return GetBinding(commandController.Commands[Name]).ProvideValue(serviceProvider);
|
|
|
|
|
|
+ return GetBinding(commandController.Commands[Name], Converter).ProvideValue(serviceProvider);
|
|
}
|
|
}
|
|
|
|
|
|
- public static Binding GetBinding(ActualCommand command) => new Binding
|
|
|
|
|
|
+ public static Binding GetBinding(ActualCommand command, IValueConverter converter) => new Binding
|
|
{
|
|
{
|
|
Source = command,
|
|
Source = command,
|
|
Path = new("Shortcut"),
|
|
Path = new("Shortcut"),
|
|
Mode = BindingMode.OneWay,
|
|
Mode = BindingMode.OneWay,
|
|
- StringFormat = ""
|
|
|
|
|
|
+ StringFormat = "",
|
|
|
|
+ Converter = converter
|
|
};
|
|
};
|
|
}
|
|
}
|