Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 227385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:35:38+00:00 2026-05-11T19:35:38+00:00

Well this question relates to MVVM pattern and i could good and fast answers

  • 0

Well this question relates to MVVM pattern and i could good and fast answers on this forum so I thought to ask and clear the confusions i had about the pattern.

I am quite new to MVVM approach. I appreciate the pattern and understand the principals behind it. Maybe I have not worked that much with the pattern that’s why there are a few confusions.

If there is a scenario in which I want to load few parts of my WPF page dynamically with XAML and still want to be compliant with MVVM approach.

The confusion is:

  1. Where the logic of loading a view dynamically with XAML reside.
  2. Whether I should have a single ViewModel for my WPF page or each seperate part have its own viewmodel with interactions with other viewmodel classes.
  3. What if I had to build control tree displayed on the GUI using C# code in the codebehind itself.
    For the controls created using code should I do the commandbindings in the codebehind of the view itself.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:35:39+00:00Added an answer on May 11, 2026 at 7:35 pm

    Where the logic for loading goes is something not really addressed by the pattern itself. There’s an interesting blog post about this by Ward Bell. There’s any number of ways to skin this cat, and they’re all compatible with MVVM. Not really the answer you’re looking for, I know, but it’s honest :). Check out Ward’s blog post… you’ll get a much more in depth discussion of this topic.

    As for whether or not to have a single VM for the page, or one for each control, that just depends. Generally, I have one for the page. If there’s some portion that reusable elsewhere, I break it out into a user control with it’s own VM, which means we have a VM within a VM. I don’t agree with rockeye on this one. There isn’t a one-to-one relationship between V-VM-M. You’re Models are designed according to business needs, with NO regard to presentation at all. You’re ViewModels are designed according to your presentation needs, and may encapsulate more than one Model. In fact, it’s very common for them to encapsulate many models.

    Like rockeye, I don’t understand your last question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, I tried to ask this question as a comment on this question, but
Hello good people of stackoverflow, this is a conceptual question and could possibly belong
Well this is a simple question i want to filter two elements sorted reverse
I believe this question applies equally well to C# as to Java, because both
I know this question may well be the silliest question you've heard today, but
Well, first of all sorry about this question it must be pretty straight forward
Well, I'm learning Scala so this question may be too basic for most people.
Well! I feel really stupid for this question, and I wholly don't mind if
This may well be a dumb question and if this has already been answered
This is probably a really newbie question (well, I'm pretty sure it is), but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.