WPF命令和事件之间的区别是什么? [英] What is the difference between WPF Command and Event?
问题描述
WPF之间的区别是什么命令
和事件
?
What is the difference between WPF Command
and Event
?
推荐答案
一般来说,你可以做几乎与事件与命令,它是处理用户交互只是一个不同的模式。
Generally speaking you can do almost the same with events as with commands, it is just a different pattern of handling user interaction.
命令
在WPF让您的命令处理程序的实现移动到楼内设有商务层。命令结合启用状态executation,所以一切都在发生。里德更多通过搜索MVVM模式。
Commands
in WPF allow you to move the implementation of a command handler to the buisness layer. Commands combine Enable state and executation, so everything is in place. Reade more by searching for the MVVM pattern.
命令更复杂的实施在第一,所以如果你的应用程序是小,你应该考虑的只是坚持到事件。
Commands are more complex to implement at first, so if your application is small you should consider just sticking to events.
这篇关于WPF命令和事件之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!