本文介绍了ICommand方法执行参数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试从wpf了解ICommand.
I try to understand the ICommand from wpf.
在我的Event类中,我实现了ICommand及其方法.
In my Event class I implement the ICommand and their methods.
一种方法是Execute:
one method is the Execute:
public void Execute(object parameter) { //Do something }现在是我的问题:什么值包含Execute中的参数parameter?
now is my question: what value contains the parameter parameter from Execute?
推荐答案该值取决于您传递到命令的值.
That value depends on the value you pass to the command.
像摘要一样
Command="{Binding CalculateCommand}" CommandParameter="LCM"/>查看此处:带有参数传递的命令绑定了解更多信息.
Look here: Command Binding with Parameter Passing for more details.
更多推荐
ICommand方法执行参数值
发布评论