XAML:
<UserControl.CommandBindings>
// Command Binding
<CommandBinding Command="Save"
CanExecute="SaveCanExecute"
Executed="SaveExecuted">
</CommandBinding>
// Custom Command Binding
<CommandBinding Command="{x:Static local:WorkOrderDetailsTreeViewModel._SetEditorFocus}"
Executed="_SetEditorFocusExecuted"/>
</UserControl.CommandBindings>
In Code Behind:
public static RoutedCommand _SetEditorFocus = new RoutedCommand();
public ConstructoyOfTheClass()
{
_SetEditorFocus.InputGestures.Add(new KeyGesture(Key.F5, ModifierKeys.None));
}
אין תגובות:
הוסף רשומת תגובה