devforce

How can i access a control in mvvm model in viewmodel?

为君一笑 提交于 2019-11-30 10:10:06
问题 I have a WPF Window, and in that window I have a grid. I use M-V-VM model and I want to add a TextBox to the grid dynamically in code(in viewmodel) How can I get access to the grid? 回答1: Use Supervising Controller pattern. Reading: Example implementation for CaliburnMicro MVVM framework is shown here (will work same for all other frameworks - or you can do it by hand if you are doing MVVM by yourself): http://drc.ideablade.com/devforce-2012/bin/view/Documentation/cocktail-tutorial-talk-to

How can i access a control in mvvm model in viewmodel?

匆匆过客 提交于 2019-11-29 18:57:36
I have a WPF Window, and in that window I have a grid. I use M-V-VM model and I want to add a TextBox to the grid dynamically in code(in viewmodel) How can I get access to the grid? nihique Use Supervising Controller pattern. Reading: Example implementation for CaliburnMicro MVVM framework is shown here (will work same for all other frameworks - or you can do it by hand if you are doing MVVM by yourself): http://drc.ideablade.com/devforce-2012/bin/view/Documentation/cocktail-tutorial-talk-to-view Example: 1) Define interface IView in which ViewModel ( VM ) will talk to View with the required