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

4
votes
1answer
480 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
1answer
171 views

Loose Coupling Presenter to View in MVP

We work in a Java shop here and our web application uses an implementation of the MVP architectural pattern. Our manager comes from a .NET world, where he has been exposed to the MVVM design pattern. ...
0
votes
0answers
11 views

WPF Control Lifeycle and Navigating through Containers to set Focus

I wanted to understand a control's lifecycle in WPF. Let me explain my scenario: I have a complex screen containing various container controls hosting forms. Let's say my screen has 3 Accordion ...
2
votes
1answer
229 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 ...
0
votes
3answers
333 views

What is the main goal of MVVM pattern? [closed]

Could you tell me what is the goal of the MVVM pattern? What are the arguments or the reasons I can give to a team and product owner to respect and develop according to this pattern? I would like a ...
1
vote
1answer
249 views

Syncing objects from code with the view in WPF

I've been reading some into it, but I am time pressed, so I would require a simple solution now and I promise to read up on it later. I come from a winforms c# background, and have lately been working ...
0
votes
1answer
53 views

Again MVVM / MVP story , passing interface of a view to its view model why it is bad?

I have used WPF for an Enterprise solution (hundreds views heavily used Data inputs and validation) in MVP pattern (it was a clean solution usually small amount of code behind forms and main code was ...
2
votes
2answers
156 views

When using MVVM, should you create new viewmodels, or swap out the models?

Say I have a viewmodel like this: public class EmployeeViewModel { private EmployeeModel _model; public Color BackgroundColor { get; set; } public Name { get { return ...
0
votes
0answers
18 views

Create a subclass of model for class-based viewmodel creation

Is it justified to create a model subclass just for creation of appropriate viewmodel based on this class. Am I missing something? How to pass data about model into viewmodel?
32
votes
10answers
12k views

When does implementing MVVM not make sense

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 ...
3
votes
3answers
263 views

Should IoC container be part of portable library?

I am seeing the benefits of Portable Class Libraries for centralizing Models and ViewModels to a single code-base. Where should dependency injection management (IoC container) take place, though? My ...
14
votes
5answers
2k 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 ...
0
votes
0answers
59 views

Inputs and outputs to a method mixed in the UI

I am designing the front end of an WPF application using MVVM where basically all we are doing (for now) is calling a method with some inputs and displaying the outputs. There are two types of ...
1
vote
1answer
154 views

How to create a WinForms project that is “WPF-ready”

I'm a C# developer who hasn't had the privilege of learning WPF yet. However, I recently initiated the architecture phase of a new project which I expect will eventually employ WPF (probably; although ...
1
vote
4answers
179 views

In MV* pattern where does non-business model goes?

I am passing Menu items to View from ViewModel. My menu definition is a model with properties title, image, hasChildren and isEnabled. But this model is meant for UI unlike business domain models like ...
0
votes
0answers
124 views

Should you implement a repository pattern with an MVVM javascript framework?

When coding a MVVM pattern I use Dependency Injection (DI) and try and code against interfaces. One of the common patterns is a Repository pattern, so I can swap my data storage provider. If I'm ...
-1
votes
1answer
345 views

Where do put INotifyPropertyChanged Interface in Model or ViewModel [closed]

I am new to MVVM pattern I have a window which has 3 text boxes namely Name,Address,Description ,a save button and a listview which displays the above fields Name,Address,Description respectively ...
0
votes
0answers
43 views

MVVM / API design: who is responsible for what in the example inside?

Note: this question is about the MVVM pattern in general and not related to any specific MVVM framework. I am wondering what the best design approach for the requirements below is (hypothetical ...
0
votes
2answers
235 views

Model and ViewModel for View

I am new to the MVVM pattern. I have a window which has 3 text boxes (Name, Address, Description), a save button, and a listview which displays the above fields. When the save button is clicked I want ...
3
votes
1answer
124 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 ...
1
vote
2answers
203 views

I know the language but still can't code like other peers [closed]

I have moved to a new job and code base (been doing C#, .NET, Windows Forms, etc. for last four years) and I have been on this for three months until today. During these three months I caught up with ...
0
votes
1answer
159 views

What shoud MainWindow of a WPF contains

I am making a WPF application following MVVM model. I have seen some approaches for applying MVVM. I am concerned about my MainWindow.xaml. In some tutorials I have seen that MainWindow is only ...
2
votes
1answer
89 views

Where does non-MVVM code belong in an MVVM app?

By non-MVVM code, I mean things like highly generalized components, like one with common extension methods for CLR types, and other 'homeless' helper classes etc? I have a Core project that most ...
7
votes
2answers
3k 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 ...
3
votes
2answers
288 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
4answers
1k 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 ...
1
vote
3answers
636 views

How do I know if I'm violating MVVM with WPF? [closed]

I was recently grabbing an auto generated TreeViewItem from a nested TreeView node in WPF, and I was using ItemContainerGenerator to get it in code behind. Then I thought to myself I'm certainly ...
1
vote
2answers
372 views

Should code-behind in WPF be considered part of the view?

I've read plenty of articles around different patterns in use with WPF and this is something I've yet to understand: should a code-behind file be considered part of the view? As a consequence, should ...
7
votes
3answers
4k 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 ...
0
votes
0answers
191 views

wpf and mvvm printing report startegy

I am developing a WPF application and I need some clarity on printing in WPF and MVVM (I am using MVVM-Light). I want to create standard looking reports for my application and I don't want to have to ...
0
votes
3answers
886 views

MVVM application architecture, where to put dependency injection configuration class, BusinessLayer and Common interfaces?

Planning my architecture for an MVVM application I come to this: MyApp.UI View MyApp.BusinessLayer ViewModel MyApp.DataAccessLayer RepositoryImplEF MyApp.DomainLayer DomainObject ...
1
vote
3answers
836 views

MVVM and service pattern

I'm building a WPF application using the MVVM pattern. Right now, my viewmodels calls the service layer to retrieve models (how is not relevant to the viewmodel) and convert them to viewmodels. I'm ...
2
votes
0answers
107 views

Sub routing in a SPA site

I have a SPA site that I'm working on, I have a requirement that you can have subroutes for a page view model. Im currently using this 'pattern' for the site MyApp.FooViewModel = MyApp.define({ ...
-1
votes
1answer
162 views

Converting between data and presentation types

I'm quite new to stuff like DI, MVVM and WPF altogether, so it's fairly possible this reads like a giant WTF... I have defined an interface in my business layer, ISomeEntity; then in my data layer, I ...
4
votes
3answers
1k 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 ...
6
votes
4answers
580 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 ...
2
votes
5answers
3k views

MVVM ViewModel and Commands

I need a bit of help to understand the relationship between a viewmodel and a command, and the responsibility of the viewmodel. I'll try to give an example (using Caliburn Micro). I have a viewmodel ...
0
votes
2answers
1k views

MVVM pattern - Best design approach to manage an application

One year ago, I discovered the WPF technology and I developed a little application, as first experiment, to compare the content of two different directories. The content of each directory is shown in ...
3
votes
2answers
205 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 ...
3
votes
3answers
2k 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 ...
7
votes
4answers
3k 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 ...
4
votes
1answer
859 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 ...
1
vote
1answer
297 views

Checklist for coding MVVM web application [duplicate]

We are a small team working on a web application using MVVM design pattern using technologies like .NET, Knockout and HTML. I am trying to come up with a code review checklist for this, so that my ...
3
votes
1answer
344 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 ...
1
vote
2answers
200 views

Why DependencyProperties and not native language support?

With advent of WPF and MVVM Microsoft introduced DependencyProperties and INotifyPropertyChange interface to provide a way to implement the "reactive" approach used with those technologies. Sadly ...
0
votes
2answers
246 views

What is this variation of MVC in JavaScript?

I am working on sorting out my Javascript code. Currently I have views implemented without any Model or collection. Now I working on separating Model from View. So for this transformation, I am ...
7
votes
3answers
1k 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. ...
1
vote
1answer
72 views

For a front-end application broken down in a MV* manner, should I have models dedicated to UI logic?

I am not talking about simple UI logic like clicking a button directs you to another page, but where one action may result in several different of behavior depending on current application state, and ...
4
votes
2answers
420 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
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 ...