且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

选择绑定的ViewModel属性或使用MVVM Light Toolkit在ViewModel和View之间进行通信的消息传递之间进行选择

更新时间:2023-10-08 22:53:22

在MVVM中. ViewModel通过DataBinding和Command与View通信.如果您需要其他功能,则需要使用此方法来实现. 消息传递应该仅用于ViewModels.视图应该是ViewModel中数据的愚蠢"可视化工具.

In MVVM. ViewModel comunicates with View through DataBinding and Commands. If you need some other functionality, you need to implement it using this means. Messaging is supposed to be only for ViewModels. Views are supposed to be "stupid" visualisers of your data in ViewModel.