如何在C#wpf应用程序中引发ICommand事件
下面是如何在C#wpf应用程序中引发ICommand事件的代码如何在C#wpf应用程序中引发ICommand事件,c#,C#,下面是如何在C#wpf应用程序中引发ICommand事件的代码 public ICommand CancelCommand { get { return new DelegateCommandWrapper(CancelButton); } } “募捐活动”是什么意思?你的意思是呼叫命令???您应该将命令绑定到UI中的按钮或其他东西。有点像 <Button Command = "{Binding CancelCommand}" Content="Cancel"/> 在
public ICommand CancelCommand
{
get { return new DelegateCommandWrapper(CancelButton); }
}
“募捐活动”是什么意思?你的意思是呼叫命令???您应该将命令绑定到UI中的按钮或其他东西。有点像
<Button Command = "{Binding CancelCommand}" Content="Cancel"/>
在您的XAML文件中…来自Codebehind/ViewModel,您只需执行以下操作
CancelCommand.Execute(null);
如
CancelCommand.Execute(空)代码>?