Fundamental MVVM(visualstudiomagazine.com)

submitted by dpetersondpeterson(4397) 9 months, 3 days ago

John Papa goes to great lengths to write an MVVM introduction for "the rest of us". He forgoes the heady, lengthy explanation and gives us a concrete sample that is easy to understand. For anyone who doesn't know the MVVM pattern, or is having difficulty understanding it or how it is useful, this post is for you.

2 comments |category: |Views: 53

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by vijaystvijayst(1311) 9 months, 2 days ago 0

There is always a clear distinction between the Model and the ViewModel. The View requires a model specific to the View. Creating such a model is the ViewModel. The post describes this difference really well.

I have been working with ASP.NET MVC for over a year now. The more I work with it, the more I am inclined to use the Model in MVC (more) as a ViewModel. For projects with complex UI, a ViewModel (folder) should exist and should be separate from the Model folder. ViewModels can have DataAnnotations and UI specific logic. Models are more tied with the data entities.

Reply

posted by dpetersondpeterson(4397) 9 months, 2 days ago 0

MVC and MVVM are not all that different, really. The main conceptual difference is that rather than directly interacting with the View, the ViewModel's properties are subscribed to and bound to the controls on the View. Doing things that way provide loose coupling between the View and ViewModel, which you don't necessarily have between the View and the Controller in MVC.

Reply

information Login or create an account to comment on this story