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 6097685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:04:19+00:00 2026-05-23T13:04:19+00:00

I am working on an app where I am trying to use MVVM for

  • 0

I am working on an app where I am trying to use MVVM for the first time. After reading some things, I think I might have misunderstood what goes in the Model.

All my app does right now is make a request to get some data, display it, allow the user to edit it, and save it if changes were made.

Here is an example of my current setup. I read some Employee data, which returns groups of employees (“Managers”, “VPs”, etc.). Each group contains a list of people. I created an interface to represent the groups:

public interface IEmployeeGroup : INotifyPropertyChanged
{
    bool IsDirty { get; set; }
    string GroupName { get; set; }
    ObservableCollection<IPerson> People { get; set; }
}



public interface IPerson : INotifyPropertyChanged
{
    bool IsDirty { get; set; }
    string PersonName { get; set; }
    int Id { get; set; }
}

I then create concrete EmployeeGroup and Person classes implementing those interfaces. And thats all they do, expose the specified properties.

That is all I have for my model.

My view model implements the below interface:

public interface IEmployeeGroupsViewModel
{
    ICommand AddEntryCommand { get; }
    ICommand SaveCommand { get; }

    ObservableCollection<IEmployeeGroup> EmployeeGroups { get; set; }
    ObservableCollection<IPerson> People { get; set; }
}

The view model makes the call to get the actual data, creates the EmployeeGroup and Person objects, and then returns them in properties for the view to bind to. When the user wants to save his changes, the view model makes the call to persist the changes.

Am I putting too much in my view model, which should be in the model instead? Right now my model does nothing, they are just the classes that represent the objects.

If I am off track here, can someone give me some advice? How would I change my above scenario for example?

Thank you.

  • 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-23T13:04:20+00:00Added an answer on May 23, 2026 at 1:04 pm

    There’s nothing wrong with your approach. You are free to either expose mapped model properties from your view model if they require formatting, or you can expose your model directly from your view model if no changes need to be made.

    MVVM is about testability, not pattern purity. As long as what you are doing works, you can always refactor later.

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

Sidebar

Related Questions

I have a small app I'm working on where I'm trying to use Django's
I'm working with android and trying to use some native code in my app.
I'm trying to use the Joda Time library for my Android app to have
I am trying to use Core Data in an app I'm working on; in
I'm working on a PHP web app and I'm trying to use the MVC
Im trying to get debugging working without an app.config. I have the following code:
I'm trying to use AppleScript to modify some app settings. The code looks like
I am trying to use Spring Security 3.1 in my web app. I have
I've been trying to get a basic app working that doesnt use an XIB.
I'm working on an app and trying to use the Facebook behavior for 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.