Hi, I want to add Controls dynamically from ViewModel. I have to add Button and Textbox dynamically to the Grid. In the ViewModel constructor call I need to add the controls. I am not getting how to get the Grid control reference in my ViewModel. Can anybody help me on this? Thanks in advance
views:
21answers:
1
+3
A:
That would be the wrong way. Your ViewModel should not be directly aware of the View.
You could create a UserControl (or maybe a template) for your Button+TextBox and bind it to a property (or List) of a specialized ViewModel on your main ViewModel.
Henk Holterman
2010-08-28 08:33:11