public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { var eventCommandWrapper = new RoutedEventAndCommandWrapper(); foreach (var value in values) { if (value is RoutedEvent) { eventCommandWrapper.RoutedEvent = value as RoutedEvent; } else if (value is ICommand) { eventCommandWrapper.Command = value as ICommand; } } return(eventCommandWrapper); }
public static void SetCommandToEventProperty(DependencyObject dependencyObject, RoutedEventAndCommandWrapper commandToEvent) { dependencyObject.SetValue(CommandToEventProperty, commandToEvent); }