Intersoft ClientUI Documentation
Command Property
See Also  Send Feedback
Intersoft.Client.UI.Aqua.UXCollection Namespace > UXTreeViewItem Class : Command Property






Gets or sets the command to invoke when this button is clicked.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Action")>
<TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")>
Public Property Command As ICommand
Visual Basic (Usage)Copy Code
Dim instance As UXTreeViewItem
Dim value As ICommand
 
instance.Command = value
 
value = instance.Command
C# 
[CategoryAttribute("Action")]
[TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")]
public ICommand Command {get; set;}
Delphi 
public read-write property Command: ICommand; 
JScript 
CategoryAttribute("Action")
TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")
public function get,set Command : ICommand
Managed Extensions for C++ 
[CategoryAttribute("Action")]
[TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")]
public: __property ICommand* get_Command();
public: __property void set_Command( 
   ICommand* value
);
C++/CLI 
[CategoryAttribute("Action")]
[TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")]
public:
property ICommand^ Command {
   ICommand^ get();
   void set (    ICommand^ value);
}

Example

The following example shows how to assign a command to a UXTreeViewItem which will be executed when the item is selected.

XAML Copy Code
<Intersoft:UXTreeView>
    <Intersoft:UXTreeViewItem Header="Add new task" Command="{Binding AddNewTaskCommand}" />
</Intersoft:UXTreeView>

Remarks

UXTreeViewItem implements ICommandSource interface which exposes Command, CommandParameter and CommandTarget property. You can assign a command to a UXTreeViewItem by setting its Command property to the target command existed in your application. With commanding, you can separate the actual logic of the command from the command definition, which is ideal for MVVM pattern application. To learn about MVVM pattern, see MVVM Pattern Overview.

For more information on how to implement routed command in your application, see How-to: Implement a RoutedCommand. For more information about the basics of commanding concept, see Commanding Overview.

Depending on the scenarios you want to achieve, you may want to evaluate when to use command or selection in your application. It's best practice to use commanding when you have a particular action to execute when a node is selected. However, if you simply wish to capture the current selection in the control, please use the SelectedItem or SelectedItems property.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.