My WPF application has a TextBlock
control in it. I want to display an "easter egg" when the user holds down the shift key and right double clicks on it.
I've added a RoutedUiCommand
to a static class in my application where I've defined all of the commands. I've added a command binding for my new command:
<UserControl.CommandBindings>
<CommandBinding CanExecute="ShowDiagnostics_CanExecute" Command="cs:CarSystemCommands.ShowDiagnostics" Executed="ShowDiagnostics_Executed" />
</UserControl.CommandBindings>
When I created the RoutedUiCommand
, I specified a MouseGesture
of RightDoubleClick
with a ModifierKey
of Shift
. So far so good.
How do I associate the command with the TextBlock
?