ICommand method execute parameter value

只愿长相守 提交于 2019-12-01 10:06:12

问题


I try to understand the ICommand from wpf.

In my Event class I implement the ICommand and their methods.

one method is the Execute:

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

now is my question: what value contains the parameter parameter from Execute?


回答1:


That value depends on the value you pass to the command.

like a sniplet:

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

Look here: Command Binding with Parameter Passing for more details.



来源:https://stackoverflow.com/questions/11187052/icommand-method-execute-parameter-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!