0

I am working on wpf mvvm pattern. I have different user controls. Based on the checkbox selection, I want them to be loaded in the main screen (that is also a user control). I have one HomeViewModel class which I have been using to bind the user controls of my project. Can you help me with a suitable way?

1
  • What have you tried? What exact problem are you encountering? If you provide some code showing what doesn't work that might help us to answer your question. Commented May 4, 2016 at 12:12

1 Answer 1

1

You should have different ViewModels for each kinds of UserControl.

  1. Create different DataTemplates for each ViewModel Types
  2. Put a ContentControl with binding a property of HomeViewModel -
  3. Value of property will be an instance of ViewModel ( UserControl's) and is set by toggling CheckBoxes.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.