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
54 views

JavaScript - Clientside seperation of Model and ViewModel?

I am developing web apps using the Model-View-ViewModel approach with Knockout.js. After reading on the original introduction of MVVM by John Gossman, I realized that my ViewModel always contains ALL ...
0
votes
1answer
108 views

Alternative to ObservableCollection in c# wpf MVVM

I am new to wpf c# and MVVM approach. I have a working program that demonstrate the MVVM approach in wpf c# (by copying some code from the internet and applying it to may program). I have used ...
3
votes
3answers
120 views

MVVM Commands - one command for everything or multiple commands?

In my last company, on handling view commands, in the ViewModelBase there were one central command implemented, like public ICommand ToolCommand { get; set; } And in the ViewModelBase, it's been ...
0
votes
2answers
126 views

Stateless vs Stateful ViewModel

Here are two links which briefly describe the difference between the two: stateless, stateful In short in the "Stateless" scenario we bind views directly to models, view models just expose the whole ...
1
vote
0answers
90 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, ...
6
votes
1answer
144 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
114 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
0answers
158 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 ...
1
vote
0answers
53 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 ...
2
votes
2answers
51 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 ...
0
votes
0answers
24 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
3answers
215 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 ...
3
votes
2answers
199 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} {...
3
votes
1answer
720 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
171 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 ...
3
votes
1answer
197 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 ...
1
vote
1answer
551 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 ...
0
votes
1answer
428 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
0answers
153 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
62 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). I'...
1
vote
2answers
890 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 ...
2
votes
1answer
263 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
1answer
96 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
104 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 - ...
0
votes
0answers
35 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 ...
1
vote
1answer
307 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 ...
2
votes
1answer
641 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
513 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
1answer
64 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. ...
0
votes
1answer
105 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 ...
4
votes
2answers
148 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 ...
13
votes
2answers
5k 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
309 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). ...
4
votes
1answer
263 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" (https://...
2
votes
1answer
204 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 ...
1
vote
0answers
97 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
230 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 ...
6
votes
1answer
335 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
1answer
334 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
285 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 ...
2
votes
2answers
295 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 ...
0
votes
1answer
120 views

Handling Destructors in MVVM

I'm making a Model View View-Model (MVVM) application using Delphi XE6. Since I'm using Pascal rather than C#, I need to manage destruction myself. I'm not sure how to handle form destruction. My ...
1
vote
0answers
116 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 = // ...
2
votes
0answers
258 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
1k 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 ...
2
votes
1answer
5k views

Strongly typed views, ViewModel and MVC

I'm learning MVC and the book I'm using favors strongly-typed views. Some of these concepts are new to me and I'm trying to better understand the design philosophy. Strongly typed views typically ...
3
votes
1answer
2k 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) ...
14
votes
4answers
728 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 ...
0
votes
1answer
423 views

Does this diagram give a good representation of the MVVM pattern?

I am having a really hard time understanding the basic structure of the Model, View, View Model pattern. I have honestly been pretty ignorant of design pattern conventions until recently. My formal ...
5
votes
1answer
2k 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 ...