Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a RoutedCommand and a RoutedUICommand?

I have tried to do some reading about it, but I failed to find documentation that explains the difference between RoutedCommand and RoutedUICommand satisfactorily.

like image 780
Dabblernl Avatar asked Oct 18 '09 12:10

Dabblernl


People also ask

What is RoutedCommand?

The RoutedCommand raises the PreviewExecuted and Executed routed events. These events traverse the element tree looking for a CommandBinding for this particular command. If a CommandBinding is found, the ExecutedRoutedEventHandler associated with CommandBinding is called.

Why would you want to use Routed commands instead of events?

Routed commands give you three main things on top of normal event handling: Routed command source elements (invokers) can be decoupled from command targets (handlers)—they do not need direct references to one another, as they would if they were linked by an event handler.


1 Answers

RoutedUICommand derives from RoutedCommand and adds a text field used to provide a description of the command. This is useful when the command is bound to be accessed from the UI.

I got this from here.

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

like image 139
o.k.w Avatar answered Sep 20 '22 02:09

o.k.w