ICommand方法执行参数值

编程入门 行业动态 更新时间:2024-10-26 18:24:37
本文介绍了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方法执行参数值

本文发布于:2023-11-13 23:38:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585624.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   方法   ICommand

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!