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

1
vote
2answers
616 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 ...
3
votes
1answer
719 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. ...
2
votes
1answer
114 views

What does “Stateful” means in Stateful ViewModel in MVVM

I was reading about some XAML patterns, and there was the Stateful ViewModel, according to what I read it has nothing different than what we as just the "ViewModel". Here's a description for example ...
2
votes
1answer
296 views

Usage of MVVM in iOS

I'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel) ...
1
vote
1answer
26 views

Should MVVM models contain complex objects

Let us say that I have a Book class, a book can have an object of another class like an Author or other complex objects like a list of Genres. My question is, in an MVVM model should I make the ...
4
votes
0answers
201 views

Design patterns for navigation between pages on mobile platforms

I'd like to ask you about the best way of handling navigation between pages/activities on mobile platforms. To be more specific - about handling state in more complex apps, about handling 'Back' ...
3
votes
0answers
364 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: ...
2
votes
0answers
125 views

Hierarchical ViewModels and tracking IsDirty/PropertyChanged events

I have a set of ViewModels depicted like in the below picture. And, I have a couple of commands AcceptCommand, CancelCommand in the Top Level View Model that are bound to Apply, Cancel buttons ...
2
votes
0answers
130 views

Is it improper to have an application wide source for dropdown binding

The WPF Combobox needs to bind a collection to it's ItemsSource and something to bind the selected item or value to. Until now, I've included both the collection and the selected value properties that ...
2
votes
0answers
620 views

What's the best way to expose a Model object in a ViewModel?

In a WPF MVVM application, I exposed my model object into my viewModel by creating an instance of Model class (which cause dependency) into ViewModel. Instead of creating separate VM properties, I ...
2
votes
0answers
520 views

Best Practice Method for Including Images in a DataGrid using MVVM

All, I have a WPF DataGrid. This DataGrid shows files ready for compilation and should also show the progress of my compiler as it compiles the files. The format of the DataGrid is Image|File Path ...
1
vote
0answers
42 views

Should my combobox for boolean values be in code-behind or in my viewmodel?

I ran into a disagreement with a coworker of mine on the implementation of representing a Boolean value in a ComboBox using Xaml and MVVM. Currently, my viewmodel is very simple. I have a bool? which ...
1
vote
0answers
91 views

Single page application automatically download dependent HTML

I'm currently developing an application using ASP.NET MVC5 and Knockout. For now, the typical architecture is this: FooController.cs: public ActionResult GetFoos(){ //... var model = // ...
1
vote
0answers
483 views

Should UserControl's be Views in an XAML MVVM application (WPF or Store app)?

I am about to use Caliburn.Micro for a new XAML Store app (not sure what to call it nowadays - does not appear to be called a "Windows Store app" any longer). The documentation (see Simple Navigation ...
1
vote
0answers
103 views

How to use data shaped by the UI from the ViewModel while keeping concerns separated?

I'm coming from a winforms background and trying to get ahold of MVVM and XAML. Right now I'm wondering how I can take advantage from a data-shaping control (either native or provided by a third ...
0
votes
0answers
74 views

Is there a better way to retrieve a ViewModel container starting from a Model?

I'm trying to figure out a more efficient method. To start, I have a viewmodel wrapping around a model. The model itself collectively becomes a tree. We'll call each model a Fragment: public class ...
0
votes
0answers
139 views

Should you register other services in ViewModelLocator in MVVM light?

I'm new to MVVM Light and SimpleIoC. My question is, should all the registration of view models and other services be done in the ViewModelLocator class? Or should ViewModelLocator be used only for ...
0
votes
0answers
247 views

Nhibernate operations on a separate thread for a desktop MVVM application

I am developing a single user .net desktop application that lists numerous (over 2000) contacts sorted by an algorithm. I use NHibernate and did consider a session per use case (or conversation as it ...
0
votes
0answers
137 views

Correct Command Management with IoC and MVVM

I have developed an MVVM framework that can be inherited by a project and used to back a new application. This application can then have plugins (like a CodeEditor for example) which automatically are ...
0
votes
0answers
227 views

Encapsulate multiple properties into a single class to use as a custom DependencyProperty

My application is a WPF project implemented in C# .NET (4.5) using an MVVM architecture with no code-behind in the View. In order to eliminate the coupling between the View and the ViewModel I'm ...