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
419 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
484 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. ...
3
votes
0answers
218 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: ...
1
vote
0answers
166 views

Why should ViewModel route actions to Controller when using the MVCVM pattern?

When reading examples across the Internet (including the MSDN reference) I have found that code examples are all doing the following type of thing: public class FooViewModel : BaseViewModel { ...
1
vote
0answers
72 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 ...
1
vote
0answers
307 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 ...
0
votes
0answers
67 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) ...
0
votes
0answers
35 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
89 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
131 views

Implement OnNavigatedTo with MVVM Light, is this the correct way?

I'm developing a Windows Phone 8 app with C#, .Net Framework 4.5.1 and MVVM Light 4.4.32.7. I'm very new on MVVM pattern and I'm not sure if I'm following that pattern when I need to implement ...
0
votes
0answers
72 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
129 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 ...
0
votes
0answers
323 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 ...
0
votes
0answers
86 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
107 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 ...
0
votes
0answers
35 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?
0
votes
0answers
76 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 ...
0
votes
0answers
213 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 ...
0
votes
0answers
55 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 ...