1
我想创建一个CommandBinding的自定义类,其中执行RoutedCommand时执行ViewModel的RelayCommand。如何将RelayCommand(MVVM)绑定到RoutedCommand? (CommandBinding)
当前只有在codebehind类中创建具有Executed方法的CommandBindings的可能性。 实施例:
<CommandBinding Command="ApplicationCommands.Close" Executed="CloseCommandHandler"
CanExecute="CanExecuteHandler"/>
这需要在后面的代码CloseCommandHandler梅索德。
我想写下面的内容。
<CommandBinding RoutedCommand="ApplicationCommands.Close" Command={Binding Path=CloseCommand}/>
唯一的问题是,我无法找到气泡向下和向上的RoutedCommands的事件。 没有
OnPreviewCommand(object command, object commandParammeter)
OnCommand(object command, object commandParammeter)
哪里的RoutedCommand泡沫向下和向上处理?