which is the best practice for Command in Silverlight ..ICommand or CommandProvided by PrismFramework

Oct 3, 2011 at 7:44 AM

Hi am working on Silverlight application by using Prism Framwor.

I got confused in implementing Commanding in my application.

There is a ICommand interface in System.Windows.Input namespace

as well as there is DelegateCommand in Microsoft.Practices.Prism.Commands namespace

which  one i got to use in my application.

Oct 3, 2011 at 7:50 PM


You could use the DelegateCommand class which is the implementation provided by Prism of the ICommand interface . This class inherits from the DelegateCommandBase class, which implements the ICommand interface.

The ICommand interface defines an Execute method, which encapsulates the operation itself, and a CanExecute method, which indicates whether the command can be invoked at a particular time.

You might find more information in the Prism documentation

I hope you find this useful.

Agustin Adami