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
0answers
39 views

MVVM approach to mahapps.metro Dialogs

I want to use a ShowMessageAsync method, but, at first sight, there is no obvious way to do ViewModel binding, even though there are already a certain number of answers and examples about this. Now, ...
-2
votes
0answers
41 views

When the system metaphor does not work

I'm trying to figure out how to combine the metaphor system with patterns. For example, with MVVM or MVC. These patterns dictate a specific naming system. For example, in my project I have classes ...
6
votes
1answer
88 views

Is there a good formal pattern to manage state in MVVM?

I have started learning about Redux and React in the web-world, and the more I learn about it the more I'm realizing how painful state management is in the desktop-world with WPF's MVVM-style ...
0
votes
1answer
72 views

Recommended approach to initialize Command

I've two commands in my View Model and one of them is initialized using lazy loading and other using eager loading. Which approach is good to go? Should I use lazy loading or eager for both? View ...
1
vote
1answer
204 views

Modular Filter Architecture for WPF

I am creating a little stock-management tool for private use. I have different views, which need similar but different filters. As an example I have a "current stock" list where I can filter for ...
1
vote
0answers
107 views

How to manage dbContext in a multi-user application?

I put together my first line-of-business app using WPF/MVVM/EF6(db-first)/MSSQL and realised that multiple users could not see each others' changes because I was using one dbcontext and keeping it ...
3
votes
3answers
183 views

Multi-screen MVVM architecture/design - Should my “screen” ViewModels contain sub-ViewModels?

I'm getting beyond a simple MVVM program now, and I'd just like to sense check my current architecture and makes sure I'm going down the right path here. Everything is structured around screens, and ...
2
votes
2answers
39 views

SQL - Design concepts - Relationships - Referential Integrity - Cascading

THE SCENARIO I learned about basic database design concepts such as basic CRUD operations, referential integrity, relationships, etc., years ago. I've messed around with databases and used this ...
1
vote
0answers
45 views

Is there any way to take advantage of portable ViewModels for ASP.Net?

Microsoft supports portability when taking advantage of the MVVM pattern: https://msdn.microsoft.com/en-us/library/hh563947(v=vs.110).aspx This means that I can create a ViewModel that is reusable in ...
0
votes
0answers
38 views

Migrating off a Silverlight application to SPA - technologies

We have pretty big Silverlight LOB application. It works great, took many years to write and it's big... Back when we made a choice (2011) JS/HTML5 was in unknown state. Today we have all kind of ...
0
votes
0answers
19 views

Composite ViewModels from many Domain models

I asked a similar question on this site before but from then on things got a little more complicated. I'm trying to find the best way to implement ViewModels which are regularly composed from ...
3
votes
2answers
152 views

Is using getters in XAML view-models a bad thing?

I've recently had an argument with a colleague about using getters (without setters) in a view-model classes used by XAML. Example: public string FullName { get { return $"{FirstName} ...
10
votes
2answers
3k 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 ...
1
vote
2answers
942 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 ...
1
vote
2answers
694 views

C# .NET MVVM software architecture and naming conventions

I am currently working on a software using C# .NET and WPF with the MVVM pattern. Though the software is almost done, I have been discussing our architecture for a long time and I would like to get ...
3
votes
1answer
336 views

Mapping Domain models to ViewModel

I have an Asp.net MVC5 application structured like this: Core Domain project Infrastructure DAL project Utilities UI UI project (contains ViewModel at the moment, will probably put that ...
0
votes
1answer
124 views

Create an item in two different table with auto-increment C# SQL [closed]

First of all, let me apologize because I know my question will be very confusing since my English is pretty bad. I am working on a project for a company, mainly create a system to take care for ...
1
vote
1answer
354 views

Best practice to extend Model in View Model

I'm facing an issue where I have a Model which I want to implement a GUI for. As I'm exploring MVVM and WPF I will of course use a View Model between the View and Model. I will also have a need to add ...
3
votes
1answer
157 views

Passing MVVM objects to other classes [closed]

So I'm using C# WPF and binding to a Model View to display states. The data that needs to be displayed is spread across a couple different classes. For instance I have a class that reads out digital ...
0
votes
1answer
321 views

Switch complex WinForms app to WPF MVVM

This question is connected with my older question C# Application GUI design dependent on configuration. I have built quite big WinForms application working in industry for a few years. It ...
1
vote
1answer
222 views

Usefulness of the Command CanExecute as it exists in WPF

I want to question the usefulness of the CanExecute functionality in WPF (defined in the ICommand interface). As I think that you can achieve the same functionality thing without this feature I ask ...
1
vote
0answers
150 views

MVVM viewmodel to view correlation in adaptive UI

I am making an mvvm application for the uwp platform and I am looking for advice on the following matter. Take for example the windows 10 e-mail application, which when full screen displays both the ...
0
votes
0answers
57 views

How to organize common application state?

I'm creating a Java application with JavaFX, using the MVVM pattern to structure the presentation layer (don't get too hung up on the MVVM part, I think this applies to other MV-X patterns as well). ...
1
vote
1answer
493 views

MVVM with multiple view models that share a model

I have an application where there is an "inventor" model whose data I would like to display differently in different areas of the application. Therefore, I'd like to create different view models ...
1
vote
1answer
84 views

What are potential problems when write business logic code in GUI as MVVM pattern

Currently, I'm implementing MVVM pattern for a WPF application but not 100% no code behind, sometimes I put some business logic code into GUI and so what are potential problems for this? Thanks
2
votes
1answer
176 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 ...
3
votes
3answers
910 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 ...
2
votes
1answer
93 views

Who is responsible for setting color in MVVM?

I have an iOS app where after exceeding a certain limit, part of the user interface changes a color to alert the user. I'm using MVVM to accomplish this and division of labor looks like this: Model - ...
14
votes
5answers
7k 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 ...
0
votes
0answers
31 views

TreeView items with attached 'quick action' buttons

I’m building a visual hierarchy of objects based on the TreeView control. Each level within that hierarchy corresponds to a different kind of object, and as such it’ll be implemented as a separate ...
3
votes
1answer
1k 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) ...
13
votes
2answers
9k 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
1answer
299 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 ...
0
votes
1answer
411 views

MVVM model vs viewmodel

I am trying to wrap my head around MVVM and "models should not have behaviour". If my getter depends on an environment variable, should it be in the model or viewmodel? Does it make a difference if ...
1
vote
0answers
50 views

Promise in Web MVVM

In MVVM (or Presentation Model), my (web) view listens to a CLICK event and calls a function of the Presentation Model to ask for the result. To clarify, the presentation model lives browser-side. ...
6
votes
1answer
328 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' ...
0
votes
1answer
84 views

MVVM: Strictness of Views Referencing Models

A coworker and I have differing views on how strictly we should adhere to the MVVM concepts. I try to follow it as closely as possible where he takes shortcuts almost every chance he gets. One of my ...
0
votes
0answers
29 views

SRP in MVVM's ViewModel

I have a question about Single Responsibility Principle in MVVM. I'd like to create a group of views for Warehouse Mgmt. Software. They would be connected to properties from my document which should ...
2
votes
1answer
241 views

Where to keep persistent services in MVVM architecture?

In an MVVM application I need to use some services that are persistent, e.g. network services like P2P and WCF where the main "engine" or server endpoint must remain up and running during the lifetime ...
4
votes
2answers
143 views

Returning a slimmed down domain entity from your view model

I'm wondering how to handle a ViewModel in the traditional sense, which includes both properties and methods, and another "view model" which is simply just the properties -- perhaps the ViewModel ...
12
votes
2answers
4k views

How to choose NOT to use a framework (Caliburn.Micro, etc.) in a given MVVM application?

I have once started a MVVM/WPF project, which was eventually built and deployed, and for that I studied a lot of the Caliburn.Micro MVVM Framework. The fact is: I ended up not using Caliburn.Micro for ...
4
votes
1answer
252 views

Where to create a file in WPF/MVVM

I'm building a WPF/MVVM application that takes input from the user and generates an output document which it saves in a temporary folder and opens for display in the native application (e.g. MS Word). ...
3
votes
1answer
229 views

MVVM: Should the VM be a value type?

I have been recently strongly influenced by two lectures: Gary Bernhardt's "Boundaries" (https://www.destroyallsoftware.com/talks/boundaries) and Andy Matuschak's "Controlling Complexity" ...
1
vote
0answers
85 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 ...
0
votes
2answers
212 views

When developing an MVC framework, how should I be using Knockout.js?

I'm currently using the Laravel PHP MVC Framework to develop a web application; and it's going along quite nicely. I'm very comfortable with the expectations of the framework and how my application ...
4
votes
2answers
3k 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 ...
0
votes
0answers
185 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 ...
1
vote
1answer
1k views

Entity Framework and “ViewModel”

Earlier I asked a question about "Entity Framework and layer seperation" and found out that some people use a ViewModel to show their data in the UI. For example if we got a "Person" table and an ...
2
votes
2answers
290 views

Designing entities that should be mutable through the GUI but protected from programmer error

I have a set of entities, for now represented by very simple classes (further simplified for this example): public class Item { public string Name { get; private set; } public double ...
5
votes
2answers
939 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 { ...