How can i access a control in mvvm model in viewmodel?
问题 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