Esta documentación está archivada y no tiene mantenimiento.

InputBinding.Command (Propiedad)

Gets or sets the ICommand associated with this binding.

Espacio de nombres: System.Windows.Input
Ensamblado: PresentationCore (en presentationcore.dll)
Espacio de nombres XML:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[LocalizabilityAttribute(LocalizationCategory.NeverLocalize)] 
[TypeConverterAttribute("System.Windows.Input.CommandConverter, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] 
public ICommand Command { get; set; }
/** @property */
public final ICommand get_Command ()

/** @property */
public void set_Command (ICommand value)

public final function get Command () : ICommand

public function set Command (value : ICommand)

No se puede utilizar esta propiedad en XAML.

Valor de propiedad

The command. There is no default value.

Tipo de excepciónCondición

ArgumentNullException

the Command value is referencia null (Nothing en Visual Basic).

The following example shows how to use a KeyBinding to bind a KeyGesture to the ApplicationCommands.Open command. When the key gesture is performed, the open command is invoked.

<Window.InputBindings>
  <KeyBinding Key="B"
              Modifiers="Control" 
              Command="ApplicationCommands.Open" />
</Window.InputBindings>

KeyGesture OpenKeyGesture = new KeyGesture(
    Key.B,
    ModifierKeys.Control);

KeyBinding OpenCmdKeybinding = new KeyBinding(
    ApplicationCommands.Open,
    OpenKeyGesture);

this.InputBindings.Add(OpenCmdKeybinding);

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0
Mostrar: