This documentation is archived and is not being maintained.

ButtonBase.CommandParameter Property

Gets or sets the parameter to pass to the Command property.

Namespace: System.Windows.Controls.Primitives
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public Object CommandParameter { get; set; }
/** @property */
public final Object get_CommandParameter ()

/** @property */
public void set_CommandParameter (Object value)

public final function get CommandParameter () : Object

public function set CommandParameter (value : Object)

    <Object .../>
<object CommandParameter="commandParameter" />

Property Value

Parameter to pass to the Command property.

Most existing commands from the command libraries do not use a command parameter. Of the commands that do use a command parameter, most of these take a parameter with some primitive type value, such as an integer or a string. However, it is possible to create a custom command where that command expects a nonprimitive type as its command parameter. For a custom command case like this, setting CommandParameter in code might require a new or existing object instance. Setting CommandParameter in markup might require property element syntax, where the object element filling the property element syntax is a new element of the type expected by that command. Alternatively, setting in markup might require a reference through a markup extension to an existing object (typically these references are made with Binding Markup Extension or StaticResource Markup Extension).

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0