开发者

Embedding controls in controls with MVVM

开发者 https://www.devze.com 2023-02-05 19:33 出处:网络
I am building 开发者_如何学Gomy WPF app with MVVM and am running into a little design stumbling point.I have a top level window that has some properties that I pass down to my first level of viewmodel

I am building 开发者_如何学Gomy WPF app with MVVM and am running into a little design stumbling point. I have a top level window that has some properties that I pass down to my first level of viewmodels and I accomplish that easily enough with the viewmodel constructors. But if I want to have some usercontrols inside of that level how do I pass information down to them into their view models?

thanks for your help


You need a Dependency Property on your child UserControls that you can bind to from you main control. @Doug Ferguson explained how to do this in this SO post. Hope this helps.

0

精彩评论

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