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

  • SEARCH
  • Home
  • 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 8735133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:59:01+00:00 2026-06-13T09:59:01+00:00

In an MVVM implementation, is every ViewModel coupled to just one Model ? I

  • 0

In an MVVM implementation, is every ViewModel coupled to just one Model?

I am trying to implement the MVVM pattern in a project but I found that sometimes, a View may need information from multiple Models.

For example, for a UserProfileView, its UserProfileViewModel may need information from UserAccountModel, UserProfileSettingsModel, UserPostsDataModel, etc.

However, in most articles I read about MVVM, the ViewModel only consists on one Model via Dependency Injection. So the constructor takes in only one Model.

How would the ViewModel work when it has to get information from multiple Models? Or would such a situation ever occur in MVVM?

PS: I am not using the Prism or Unity Framework. I am trying to implement similar patterns into a project that I am working on which doesn’t use Prism or Unity. That’s why I need to understand exactly how some of these things work.

  • 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-06-13T09:59:02+00:00Added an answer on June 13, 2026 at 9:59 am

    In my understanding of the MVVM pattern, the only practical requirement is that the View gets all its data from the properties of a ViewModel (probably through a binding mechanism). The ViewModel is a class that you craft specifically for that view, and takes on the responsability of populating itself as required. You could think of it like ActiveRecord for the view.

    As such, it doesn’t matter what you do inside the ViewModel to obtain the data that its properties should show. You could get it by querying some services, reading one or more business entity models, generating it on the spot, or all of the above. It’s perfectly normal to need a combination of all these things to make a functional view.

    As in any presentation pattern, the point is just to separate the process of showing some data on the screen, from the process of obtaining that data. That way you can test each part of the process separately.

    Edit: Here’s a small but hopefully complete example of the flow of dependencies.

    // Model/service layer
    
    public class MyModelA
    {
      public string GetSomeData()
      {
        return "Some Data";
      }
    }
    
    public class MyModelB
    {
      public string GetOtherData()
      {
        return "Other Data";
      }
    }
    
    // Presentation layer
    
    public class MyViewModel
    {
      readonly MyModelA modelA;
      readonly MyModelB modelB;
    
      public MyViewModel(MyModelA modelA, MyModelB modelB)
      {
        this.modelA = modelA;
        this.modelB = modelB;
      }
    
      public string TextBox1Value { get; set; } 
    
      public string TextBox2Value { get; set; }
    
      public void Load()
      {
        // These need not necessarily be populated this way. 
        // You could load an entity and have your properties read data directly from it.
        this.TextBox1Value = modelA.GetSomeData();
        this.TextBox2Value = modelB.GetOtherData();
        // raise INotifyPropertyChanged events here
      }
    }
    
    public class MyView
    {
      readonly MyViewModel vm;
    
      public MyView(MyViewModel vm)
      {
        this.vm = vm;
        // bind to vm here
      }
    }
    
    // Application layer
    
    public class Program
    {
      public void Run()
      {
        var mA = new MyModelA();
        var mB = new MyModelB();
        var vm = new MyViewModel(mA, mB);
        var view = new MyView(vm);
        vm.Load();
        // show view here
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement IView for MVVM design pattern, which allows ViewModel to interact
ViewModel is a term that is used in both MVVM (Model-View-ViewModel) and the recommended
In the MVVM (Model-View-ViewModel) pattern should the ViewModel reference the view. I would think
Below is a sample implementation that uses metro API and data binding (using MVVM)
I recently started using WPF and the MVVM framework, one thing that I have
I'm struggling to grasp why MVVM is really a good pattern to implement in
I use MVVM pattern in my multithreading WPF app. Now in the model I
I am trying to use MVVM in Silverlight, but I am quite new to
I know I've already asked questions on this, but something that's just confusing. I'm
I am using MVVM-Light and for every view model I have to create an

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.