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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:05:29+00:00 2026-05-20T11:05:29+00:00

So I am delving into MVVM using C# with WPF (using Expression Blend) and

  • 0

So I am delving into MVVM using C# with WPF (using Expression Blend) and have run into a question of how to properly implement the gathering of data from a database and displaying it in a window.

My view is just a grid with a few TextBlocks that I can update with data from a SQL query (I am reporting the number of calls that were made to our company and by our phone agents, so All Calls, Incoming Calls, etc.)

My question is, do I need a model here to get/hold the data or is it good (or at acceptable) MVVM practice to do this in the ViewModel? If I do it in the VM I can easily implement the INotifyPropertyChanged event and everything works. If I create a model to hold the data do I then have to create an INotifyPropertyChanged in the Model and the VM or is there something else that should be used to do the notifications?

This seems like a straight forward task but I just can’t seem to find a good example of just displaying pieces of data, every example I find is of a collection and being my first MVVM program I want to make sure I do it right 🙂

I read on another post someone saying “every Model requires a VM but not every VM requires a Model”. This goes along with my question above and would just like to hear the thoughts of some experienced users.

Thanks,
Brian

  • 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-20T11:05:30+00:00Added an answer on May 20, 2026 at 11:05 am

    You *should” have a model, which you should think of as two separate pieces:
    1) a domain sort of object which encapsulates business rules and logic (ie, Customer)
    2) some data access sort of object which encapsulates data retrieval (ie, CustomerDao or CustomerRepository)

    Both of these should be injected into your view model constructor, as opposed to newing them up somewhere inside of the view model:

    class CustomerViewModel(Customer customer, CustomerDao){...}
    

    You should be testing even if it seems trivial; if it only needs one or two tests to prove it works, great.

    HTH,
    Berryl

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

Sidebar

Related Questions

I have run into an interesting performance conundrum but before I start delving into
I have lately been delving into F# and the new DSL stuff as in
After delving into the world of opensource I have found implementation is emphasised over
I have just started delving into the world of functional programming. A lot of
In delving into Fluent nHibernate, I discovered a potential breaker for using it... Given
I have been delving into C# recently, and I wonder if anyone would mind
Before delving into my question, I should first provide a synopsis of what angle
I've just starting delving into the wonders of Java ME but have become frustrated
I'm delving into some AJAX and I'm trying to utilise jQuery. I have an
I am just delving into using jQuery and I want to start off by

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.