C# ActionCommand和DelegateCommand之间有什么区别

C# ActionCommand和DelegateCommand之间有什么区别,c#,mvvm,icommand,C#,Mvvm,Icommand,如果有人能告诉我从Expression Blend和DelegateCommand类(Prism)使用ActionCommand类的区别和好处,我将不胜感激 如果我理解正确,DelegateCommand支持两个委托,而ActionCommand类只支持一个执行委托。还有其他区别吗?在阅读了文档和在线之后,我仍然不太明白使用这两种方法的好处是什么 提前感谢DelegateCommand允许委托命令逻辑,而不需要在代码中使用处理程序。它使用委托作为调用目标处理方法的方法。 像 公共类Delegat

如果有人能告诉我从Expression Blend和DelegateCommand类(Prism)使用ActionCommand类的区别和好处,我将不胜感激

如果我理解正确,DelegateCommand支持两个委托,而ActionCommand类只支持一个执行委托。还有其他区别吗?在阅读了文档和在线之后,我仍然不太明白使用这两种方法的好处是什么


提前感谢

DelegateCommand允许委托命令逻辑,而不需要在代码中使用处理程序。它使用委托作为调用目标处理方法的方法。 像

公共类DelegateCommand:ICommand
{
公共DelegateCommand(Action executeMethod、Func canExecuteMethod)
{
…
this.executeMethod=executeMethod;
this.canExecuteMethod=canExecuteMethod;
…
}
…
}
请看这里
public class DelegateCommand<T> : ICommand
{
    public DelegateCommand(Action<T> executeMethod, Func<T, bool> canExecuteMethod)
    {
        …
        this.executeMethod = executeMethod;
        this.canExecuteMethod = canExecuteMethod;
        …
    }
…
}