开发者

How can I transfer a parameter in an UserControl

开发者 https://www.devze.com 2023-02-15 10:35 出处:网络
I have a complex page with an independant UserControl (has its own ViewModel), and I want to transfer one parameter. I\'m thinking of two solution :

I have a complex page with an independant UserControl (has its own ViewModel), and I want to transfer one parameter. I'm thinking of two solution :

开发者_StackOverflow社区
  • DependencyProperty for UserControl
  • MVVM Light messenger (By the way, how to make unique the message between sender and recorder? With NotificationMessage?)

Please, could you help me to find the most appropriate solution for MVVM architecture?


You can simply use a CLR property on the ViewModel, unless you have other requirements that you don't mention.


Finaly i declared the UserControl ViewModel in View ViewModel

0

精彩评论

暂无评论...
验证码 换一张
取 消