我的WPF应用程序中有一个TextBlock
控制。当用户按住shift键并右键双击时,我想显示一个“复活节彩蛋”。显示对话框
我添加了一个RoutedUiCommand
在我的应用程序中的静态类,我已经定义了所有的命令。我添加了一个命令为我的新命令绑定:
<UserControl.CommandBindings>
<CommandBinding CanExecute="ShowDiagnostics_CanExecute" Command="cs:CarSystemCommands.ShowDiagnostics" Executed="ShowDiagnostics_Executed" />
</UserControl.CommandBindings>
当我创建的RoutedUiCommand
,我指定的RightDoubleClick
一个MouseGesture
与Shift
一个ModifierKey
。到现在为止还挺好。
如何与TextBlock
命令相关联?