的ICommand的CanExecuteChanged事件事件、ICommand、CanExecuteChanged

由网友(心悦君兮君不知)分享简介:的ICommand 包含两种方法和一个事件。 什么是两种方法做的是明确的,但我不明白是什么事件呢是在的ICommand 提供的。What the two methods do is clear, but I can’t understand what the event does that is provided...

的ICommand 包含两种方法和一个事件。

什么是两种方法做的是明确的,但我不明白是什么事件呢是在的ICommand 提供的。

What the two methods do is clear, but I can’t understand what the event does that is provided in ICommand.

当是 CanExecuteChanged 引发的事件?

下面的解释是对的 MSDN 但是我无法理解这一点。

The below explanation is on MSDN but I can’t understand it.

CanExecuteChanged 上升,如果在命令管理器的   集中指挥作业检测命令变化   来源可能无效已经提高,但不是一个命令   尚未执行该命令绑定。

CanExecuteChanged is raised if the command manager that centralizes the commanding operations detects a change in the command source that might invalidate a command that has been raised but not yet executed by the command binding.

能否请您简单的术语解释一下吗?

Can you please explain this in simple terms?

感谢......

推荐答案

CanExecuteChanged 时引发的 CanExecute 方法的的ICommand 得到改变

CanExecuteChanged is raised when the CanExecute method of an ICommand gets changed

在一些第三方库,在 CanExecuteChanged 事件也被提出,如果 CanExecute 参数提出的PropertyChanged 事件。例如,MVVM光工具包的 RelayCommand 提出了一个 CanExecuteChanged 事件,如果 CanExecute 参数提出的PropertyChanged 事件,而棱镜的 DelegateCommand 不会。

In some 3rd party libraries, the CanExecuteChanged event also gets raised if the CanExecute parameters raise a PropertyChanged event. For example, MVVM Light Toolkit's RelayCommand raises the CanExecuteChanged event if the CanExecute parameters raise a PropertyChanged event, while Prism's DelegateCommand does not.

阅读全文

相关推荐

最新文章