4 using System.Windows.Input;
6 namespace SiliconStudio.Presentation.Behaviors
16 public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
"Command", typeof(ICommand), typeof(
OnEventCommandBehavior));
21 public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register(
"CommandParameter", typeof(
object), typeof(
OnEventCommandBehavior));
26 public ICommand Command {
get {
return (ICommand)GetValue(CommandProperty); } set { SetValue(CommandProperty, value); } }
31 public object CommandParameter {
get {
return GetValue(CommandParameterProperty); } set { SetValue(CommandParameterProperty, value); } }
38 if (cmd != null && cmd.CanExecute(CommandParameter))
39 cmd.Execute(CommandParameter);
An abstract behavior that allows to perform actions when an event is raised. It supports both RoutedE...
An implementation of the OnEventBehavior class that allows to invoke a command when a specific event ...
override void OnEvent()
Invoked when the monitored event is raised.