示例#1
0
        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);
        }
示例#2
0
 public static void SetCommandToEventProperty(DependencyObject dependencyObject, RoutedEventAndCommandWrapper commandToEvent)
 {
     dependencyObject.SetValue(CommandToEventProperty, commandToEvent);
 }