【问题标题】:ICommand method execute parameter valueICommand 方法执行参数值
【发布时间】:2012-06-25 18:02:23
【问题描述】:

我尝试从 wpf 中理解 ICommand。

在我的 Event 类中,我实现了 ICommand 及其方法。

一种方法是执行:

public void Execute(object parameter)
{
    //Do something
}

现在是我的问题:Execute 中的参数 parameter 包含什么值?

【问题讨论】:

标签: c# parameters execute icommand


【解决方案1】:

该值取决于您传递给命令的值。

就像一个片段:

Command="{Binding CalculateCommand}" CommandParameter="LCM"/>

查看这里:Command Binding with Parameter Passing 了解更多详情。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-07
    • 1970-01-01
    相关资源
    最近更新 更多