Intersoft ClientUI Documentation
RoutedUICommand Class
Members  See Also  Send Feedback
Intersoft.Client.Framework.Input Namespace : RoutedUICommand Class






Defines an ICommand that is routed through the element tree and contains a text property.

Object Model

RoutedUICommand Class

Syntax

Visual Basic (Declaration) 
<TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")>
Public Class RoutedUICommand 
   Inherits RoutedCommand
Visual Basic (Usage)Copy Code
Dim instance As RoutedUICommand
C# 
[TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")]
public class RoutedUICommand : RoutedCommand 
Delphi 
public class RoutedUICommand = class(RoutedCommand)
JScript 
TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")
public class RoutedUICommand extends RoutedCommand
Managed Extensions for C++ 
[TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")]
public __gc class RoutedUICommand : public RoutedCommand 
C++/CLI 
[TypeConverterAttribute("Intersoft.Client.Framework.Input.CommandConverter, Intersoft.Client.Framework, Version=3.0.5000.1, Culture=neutral, PublicKeyToken=c3d9b11444163e76")]
public ref class RoutedUICommand : public RoutedCommand 

Remarks

The difference between a RoutedUICommand and RoutedCommand is that RoutedUICommand includes a Text property.

The Execute and CanExecute methods on a RoutedCommand do not contain the command logic for the command, as is the case with a typical ICommand. These methods raise events that traverse the element tree looking for an object with a CommandBinding. The event handlers attached to the CommandBinding contain the command logic.

The Execute method raises the PreviewExecuted and Executed events. The CanExecute method raises the PreviewCanExecute and CanExecute events.

The following code example shows the event handler for the CanExecute and Executed routed event for the CommandBinding which is associated to a routed command.

C# Copy Code
private void CutCmdCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
     e.CanExecute = true;
}
private void CutExecuted(object sender, ExecutedRoutedEventArgs e)
{
     string command = ((RoutedCommand)e.Command).Name;
     string target = ((FrameworkElement)e.OriginalSource).Name;

     MessageBox.Show("The " + command +  " command has been invoked on target object " + target);
}

For a more complete version of the above example, see How-to: Implement a RoutedCommand. For more information on commanding, see Commanding Overview.

Inheritance Hierarchy

System.Object
   Intersoft.Client.Framework.Input.RoutedCommand
      Intersoft.Client.Framework.Input.RoutedUICommand
         Intersoft.Client.Framework.Input.HybridRoutedCommand

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.