private static void OnEnabledPasteExcelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (GetEnabledPasteExcel(d) == false) { return; } var frameworkElement = d as FrameworkElement; var commands = CreateCommands(d); contextMenuBuilder.CreateContextMenuPasteForCondition(d as FrameworkElement, commands.PasteCommand, GetCreateContextMenu(d), GetEnabledPasteExcel(d)); frameworkElement.InputBindings.Add( new KeyBinding { Key = Key.V, Modifiers = ModifierKeys.Control, Command = commands.PasteCommand } ); }