/// <summary> /// Runs the ICommand when the requested RoutedEvent fires /// </summary> private void OnEventRaised(object sender, EventArgs e) { ICommand command = (ICommand)(sender as DependencyObject). GetValue(SingleEventCommand.TheCommandToRunProperty); object commandParameter = (sender as DependencyObject). GetValue(SingleEventCommand.CommandParameterProperty); SCommandArgs commandArgs = new SCommandArgs(sender, e, commandParameter); if (command != null) { command.Execute(commandArgs); } }
/// <summary> /// Runs the ICommand when the requested RoutedEvent fires /// </summary> private void OnEventRaised(object sender, EventArgs e) { ICommand command = (ICommand)(sender as DependencyObject). GetValue(SingleEventCommand.TheCommandToRunProperty); object commandParameter = (sender as DependencyObject). GetValue(SingleEventCommand.CommandParameterProperty); SCommandArgs commandArgs = new SCommandArgs(sender, e, commandParameter); if (command != null) command.Execute(commandArgs); }