The Model View ViewModel (MVVM) is an architectural pattern used in software engineering that originated from Microsoft as a specialization of the presentation model design pattern introduced by Martin Fowler.

learn more… | top users | synonyms

36
votes
10answers
16k views

When does implementing MVVM not make sense [closed]

I am a big fan of various patterns and enjoy learning new ones all the time however I think with all the evangelism around popular patterns and anti-patterns sometimes this causes blind adoption. I ...
19
votes
3answers
10k views

Who should control navigation in an MVVM application?

Example #1: I have a view displayed in my MVVM application (let's use Silverlight for the purposes of the discussion) and I click on a button that should take me to a new page. Example #2: That same ...
15
votes
5answers
3k views

Are value converters more trouble than they're worth?

I'm working on a WPF application with views that require numerous value conversions. Initially, my philosophy (inspired in part by this lively debate on XAML Disciples) was that I should make the view ...
14
votes
3answers
5k views

MVVM, DDD, and WPF Layered Application Project Structure Guidance

I am trying to setup my application's structure in VS and I want to "try" and future proof it to a reasonable level. This application will be a WPF re-write of an old Winform app that had followed no ...
13
votes
4answers
594 views

Proper Model-View-_____ design

I've been reading up about Model View Controller, Model View Presenter, Model View ViewModel, and so on, and generally, the underlying concept seems pretty simple to understand: keep the pretty ...
9
votes
2answers
5k views

Is MVVM in WPF outdated? [closed]

I'm currently trying to get my head round MVVM for WPF - I don't mean get my head round the concept, but around the actual nuts and bolts of doing anything that is further off the beaten track than ...
8
votes
5answers
4k views

Should we bind view to a model property or ViewModel should have it's own..?

I am starting a project with following technical environment : .Net 4.0, Entity Framework 4.0, WPF with MVVM Architecture I saw lots of examples on the net, some books with this environment. In some ...
8
votes
3answers
9k views

What the best way to wire up Entity Framework database context (model) to ViewModel in MVVM WPF?

As in the question above: What the best way to wire up Entity Framework database model (context) to viewModel in MVVM (WPF)? I am learning MVVM pattern in WPF, alot of examples shows how to implement ...
8
votes
1answer
2k views

Help with complex MVVM (multiple views)

I need help creating view models for the following scenario: Deep, hierarchical data Multiple views for the same set of data Each view is a single, dynamically-changing view, based on the active ...
7
votes
3answers
2k views

MVVM Clarification

We are about to write our first WPF application and are becoming familiar with the MVVM pattern. We've built many Winform applications and have an architecture that has been very successful for us. ...
7
votes
2answers
523 views

How can I “get in the know”?

My company posted a job listing to get me a helper. A recruiter called me today and all he kept saying was "MVC this Entity Framework that..." - He sounded shocked when I said the project uses ...
7
votes
4answers
5k views

How to make creating viewmodels at runtime less painful

I apologize for the long question, it reads a bit as a rant, but I promise it's not! I've summarized my question(s) below In the MVC world, things are straightforward. The Model has state, the View ...
6
votes
4answers
887 views

Clean, Modular Code vs MV* Frameworks [closed]

I've been hearing a-lot about the "new" MV* frameworks. I've tinkered with KnockoutJS, creating an invoicing application, but I much prefer to write clean, modular code in raw JavaScript - leveraging ...
6
votes
3answers
631 views

What are the rules for coupling a ViewModel and a View in the MVVM pattern?

So given the Separation of Concerns, how coupled should the View and ViewModel be? For example, I want the visibility of a Control in the View to be databound (databinded?) to a flag in the ...
6
votes
2answers
424 views

Given the presentation model pattern, is the view, presentation model, or model responsible for adding child views to an existing view at runtime?

I am building a Flex 4 based application using the presentation model design pattern. This application will have several different components to it as shown in the image below. The MainView and ...
5
votes
3answers
6k views

MVVM or MVC? Want to use the same set of classes for WPF and ASP.NET

I am a newbie in terms of Design Patterns. I just started learning MVC when I am hearing a new buzz, MVVM. I want to learn the insights of both of these by redesigning an old inventory and invoicing ...
5
votes
4answers
3k views

Lists & Collections in MVVM - which approach to take?

I'm currently working on a Silverlight app using Caliburn.Micro. At present, we have Views (eg: PeopleView) and View Models (eg: PeopleViewModel) that equate to 'pages' of the application. ...
5
votes
2answers
5k views

What are the best practices for exception handling in n-tier applications?

What are the best practices for exception handling in n-tier applications? The application is a fat client based on MVVM pattern with .NET framework.
5
votes
3answers
2k views

MVVM - child windows and data contexts

Should a child window have it's own data context (View-Model) or use the data context of the parent? More broadly, should each View have its own View-Model? Are there are any rules to guide making ...
5
votes
1answer
750 views

Are all View Models supposed to be accessed through the Main View Model in MVVM?

I am currently working on a WP8 application. My current design is to have each view bind against a specific view model directly. Looking through the samples though, it seems that another way is to ...
5
votes
1answer
360 views

wizard-like data collection implementation help (next, next, finish)

I'm beginning to build an interface for our field techs to close out work orders and we have many different required paper forms for different customers. I had hoped to build a system where i can set ...
4
votes
4answers
4k views

Who is using the MVVM architecture for large applications? [closed]

I am currently working on an LOB application which I am basing on the MVVM architecture. Going by the answers to the questions I'm asking, it seems like there are not that many people building large ...
4
votes
3answers
2k views

What are the pros and cons of the MVVM architecture?

In class today we were introduced to the MVVM architecture for Silverlight/WinPhone/WPF; it looks nice for big projects, but what are your thoughts on MVVM? What are the pros and cons? I want to get ...
4
votes
1answer
244 views

Wpf: Event driven vs MVVM design pattern

I'm a beginning coder and I've been working on a WPF app for several months now and struggled to implement anything in MVVM due to time constraits to learn so I coded my program the only way to knew ...
4
votes
4answers
387 views

What determines when an application requires mvvm?

I'm developing mobile applications for Windows Phone 7. This application calls some web services and occasionally sends responses out via web services. I recently started looking into MVVM and noticed ...
4
votes
3answers
2k views

How to use a MessageBox using the MVVM pattern?

I am implementing a UI application using the MVVM design-pattern. The thing is, sometimes when you detect that something is wrong with data that was inputted by the user, you'd like to notify him ...
4
votes
1answer
1k views

Value of MVVM in a Line of Business Application (and a Rant of Current Development Practices)

After 2 years, I'm still struggling with MVVM as a practical method of producing working software. In some cases it's great. I did a multithreaded application that controlled a small assembly line ...
4
votes
1answer
3k views

WPF, MVVM, EF, POCO guidance required on simple architecture

(sorry for my poor english) I am developing a application using WPF, EF Code First using MVVM (Caliburn.Micro). It should be used mostly to CRUD work. I created a BaseViewModel<T> class from ...
4
votes
2answers
389 views

Should Item Grouping/Filter be in the ViewModel or View layer?

I'm in a situation where I have a list of items that need to be displayed depending on their properties. What I'm unsure of is where is the best place to put the filtering/grouping logic of the ...
4
votes
1answer
1k views

Which notification pattern is preferable?

I'm working on a view model for a view that presents a dialog with export options. The user selects options then clicks Export. When the view model completes the Export, the calling view model ...
4
votes
2answers
506 views

WCF service as a proxy for publishing real-time data to a WPF/MVVM clients

I've been tasked with creating a dashboard application to show real time updates for our servers. The raw data comes in from an XML file on our intranet which I need to parse and present to the user. ...
4
votes
2answers
1k views

MVVM Reporting App Approach ? Data Access Layer?

I'm trying to follow the MVVM pattern in a reporting / statistics application that I'm making in C# / WPF. I have made many model classes to hold properties as a starting point. Some of these models ...
4
votes
1answer
4k views

Trying to learn how to use WCF services in a WPF app, using MVVM

We're working on a major re-write of a legacy VB6 app, into a WPF app. I've written several WCF services, which are meant to be used with the new WPF app. We want to use the MVVM design pattern to ...
4
votes
1answer
1k views

Is ViewModel with more than one repository bad?

I'm working on a project with MVVM. Some ViewModels have more than one repository. Is ViewModels with more than one repository bad? Please provide with why it's good/bad.
4
votes
1answer
189 views

Contract / Project / Line-Item hierarchy design considerations

We currently have an application that allows users to create a Contract. A contract can have 1 or more Project. A project can have 0 or more sub-projects (which can have their own sub-projects, and so ...
4
votes
2answers
572 views

Should MVVM ViewModel inject an HTML template for default view?

I'm working on web application design that includes Knockout.js and have an overall MVVM question: Does it make sense for the ViewModel to automatically inject a default HTML template (pulled from ...
4
votes
2answers
2k views

Hierarchical View/ViewModel/Presenters in MVPVM

I've been working with MVVM for a while, but I've recently started using MVPVM and I want to know how to create hierarchial View/ViewModel/Presenter app using this pattern. In MVVM I would typically ...
4
votes
1answer
590 views

When should the presentation model design pattern include one or more controllers?

I have been researching the usage of the Presentation Model design pattern for an application I am preparing to build. The specific technology I will be using is Flex though I doubt that it matters ...
4
votes
1answer
494 views

Examples of different architecture methodologies

Is there a resource or site which illustrates building the same application (desktop or web) using several different contrasting architectures? Such as MVP versus MVVM versus MVC, etc. It would be ...
3
votes
2answers
594 views

Examples of MVVM adoption outside the Microsoft community?

IS MVVM getting any kind of traction outside the Microsoft community? Within Silverlight this is a non-issue, but for other technologies, like JavaScript it surely is: For instance Knockout.js is a ...
3
votes
4answers
2k views

Has the MVVM pattern been adopted widely in real world Silverlight projects?

MVVM pattern is a hot word recently and I am planning to learning and refactor my existing project into this pattern. I have no experience and foresight of the potential risk. Have you guys really ...
3
votes
2answers
129 views

What is better to return from the DataService: Status or Exceptions?

I have a MVVM app with DataServices (using mvvmlight). Right now, i'm using it like var answer = await myDataService.PullList(categoryId); if (answer.Status == Ok) ...
3
votes
3answers
3k views

How to organize MVVM files in solution

I'm fairly new to the MVVM concept but like a lot of the flexibility it gives me so far. However, I'm struggling to find a good way to manage my code. I have several classes that are just sitting in ...
3
votes
2answers
1k views

Is a 'God' ViewModel desired in WPF

My application has user controls within user controls. Please see a screen shot of one of the most beautiful applications of all time (UC = user control): All the properties live in the MainWindow ...
3
votes
1answer
137 views

When is it okay to reassign the model for a view in MVC?

Is it ever really acceptable to reassign the model for a view in MVC? (Or MV* where applicable.) In other words, for a single view instance, is it ever ok to reassign the view's model? That is, as ...
3
votes
1answer
425 views

Distinguishing between UI command & domain commands

I am building a WPF client application using the MVVM pattern that provides an interface on top of an existing set of business logic residing in a library which is shared with other applications. The ...
3
votes
1answer
160 views

What conventions or frameworks exist for MVVM in Perl?

We're using Catalyst to render lots of webforms in what will become a large application. I don't like the way all the form data is confusingly into a big hash in the Controller, before being passed to ...
3
votes
1answer
444 views

MVVM light Communication

I am working on a large MVVM application. I am using the MVVM light toolkit for this. The application is like a web browser with back and forward buttons. The main view is an user control. I laid the ...
3
votes
1answer
1k views

Is it common/correct using MVVM to expect multiple views and corresponding view-models for a particular model?

Consider a somewhat contrived model that goes something like: class Player { public int Health; public int Ammo; public Weapon CurrentWeapon; public PhysicalState State { ...
3
votes
0answers
214 views

MVVM - Master Detail interaction scenarios - Implementing when MasterVm has partial data, and Detail has to pull whole entity

I primarily work with .Net WPF MVVM applications. I've used several frameworks, MVVM Light, Prism, etc, and I've been able to break the implementation of CRUD MVVM into three scenarios. Scenario 1: ...