Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

4
votes
1answer
50 views

Approach for Constructing View Models in Complex MVVM Application

I'm struggling with the design in a WPF MVVM application. In a few courses I've taken, they say that having a lot of parameters in a constructor is a code smell, but they never address how to deal ...
3
votes
1answer
52 views

View-model architecture

I have two screens: A screen with a list of items, where every item in the list has "Show Details" and "Update buttons" An item details screen. The "Show Details" button navigates to item details ...
0
votes
3answers
96 views

State of selected items in view or viewmodel?

Myself and my colleague were having a discussion about MVVM and how lists and selected items should be stored in view / viewmodel. I think the viewmodel should only offer up the data and allow the ...
1
vote
1answer
59 views

MVC: How to use data model list in recursive views

I am trying to learn web app MVC in PHP.Most of the articles discussed about 1-to-1 MVC pattern given bellow Controller: gets user request & update model, Model: receives orders form Controller &...
1
vote
0answers
42 views

How does “redux” decouple the different components so they can be tested separately in unit tests?

In the past we saw a big move from traditional MVC to MVVM for user interfaces: One of the primary motivations for MVVM is that the view and viemmodel are competely indepedently of each other and ...
1
vote
0answers
29 views

MVVM distinguish between Model and View-Model and Models relashionships on reactive architecture

This should be a simple MVVM - reactive architecture question, something that I miss probably. I'll start with a context example: I have a Music Tracks Player application with 2 models Player and ...
0
votes
0answers
33 views

MVVM composite ViewModel for sharing fuctionality (instead of inheritance)

I'm looking for design ideas for something like a composite ViewModel. I'm facing a situation where a lot of ViewModels need CRUD operations and some need refresh operations. A minority of ViewModels ...
1
vote
0answers
183 views

Proper implementation of Repository Pattern with MVVM in WPF

I am currently refactoring a WPF application that is built on the principles of the Repository Pattern. It uses Entity Framework as its ORM, and is Database First. Each of those entities is wrapped by ...
0
votes
1answer
89 views

Adding an additional layer between domain model and view model necessary?

I am working on a Xamarin application (Mvvm using Prism), I am also leveraging OData for communication between my backend and the mobile application. The structure of my Mobile app is as follows: ...
0
votes
0answers
29 views

Where to keep the code for new instance of an object in iOS project?

Example: There is a KingDetailViewController class with the following code. // MARK: - New Instance extension KingDetailViewController { class func newInstance() -> ...
0
votes
1answer
60 views

Ext JS: Designing a base class and override it

I'm trying to define a base class and override it's items on different inherited sub-classes. I'm following MVVM pattern to fetch records from backend. Created several stores and formulas within ...
0
votes
0answers
51 views

Inject ViewModels created after getting Models from DB

I am currently working on a Picture Management software where I have to follow pretty strict requirements due to specified interfaces I am not allowed to change. Therefore I am forced to have a List&...
0
votes
0answers
70 views

Should I populate view model inside or before creating it

I'm not sure if softwareengineering exchange is right for the question. I need to populate view model with some values I query from the database. I do it like: var db = new NPoco.Database(...
2
votes
1answer
71 views

ASP.Net MVC When ViewModel properties vs Ajax calls in view

When is it more appropriate to use asynchronous calls from the view to get data vs prepopulating it server-side when creating the instance of the viewmodel? For instance, if my view has some dropdown ...
0
votes
0answers
109 views

Recommended Archictecture in Android for communication between main View and RecyclerViewAdapter with MVVM

I'm trying to architect a screen with a fragment containing a date picker and some basic inputs and a list of items which more inputs. I'll try to exemplify with images: and a screen like this: ...
0
votes
4answers
233 views

Avoid type checking but preserve separation of concerns

I'm working on an MVVM project and trying to preserve separation of concerns. Our current architecture has an entity framework model and MVVM light view and viewmodel projects. I'm working ViewModel ...
1
vote
2answers
327 views

MVVM. Is it a code smell when view model has properties with names show/hide/display that semantically belong to view?

I've lately been involved with WPF and looked into MVVM. I understand that view model shouldn't be aware of view. However, sometimes I come across situation where my initial instinct is to write ...
2
votes
2answers
508 views

Adding model into another view model's collection

The Setup So I'm working on a project in which there exists a MainViewModel class. This MainViewModel contains a list of Soldiers through an observable collection. I have a button in the MainView ...
2
votes
1answer
63 views

Thick viewmodel results in thin model

How thick should a viewmodel be? For example, should my viewmodel or model handle the actual filtering? For example, let's say I have a Roster object holding a collection of Users which are ...
2
votes
1answer
176 views

What's the M in MVVM?

Is the M (model) in MVVM equal to business logic + data? Or is it just supposed to be data/state for the view? Background: In a project we use "model" as a name for an object that holds presentation ...
0
votes
0answers
224 views

MVVM Portable ViewModel / WPF/Xamarin Messaging

I have a WPF app targeting .NET 4 which I am updating and maintaining for a customer. In the course of the project, we have also ported the functionality to a Xamarin mobile app. I was able to ...
0
votes
2answers
923 views

Overall view validation with a datagrid and keeping to MVVM

I am struggling to find a good architecture for what must be a common problem Enable/Disable a button in a View that contains a datagrid, and has validation requirements on the cell, row and ...
3
votes
1answer
2k views

WPF MVVM Loading data on startup

I am building a simple master-details GUI using WPF/MVVM/Prism for some data coming from a Restful service. I have the main window as my main view with a corresponding view model. I have a user ...
1
vote
2answers
1k views

How to implement validation before setting a property value in MVVM (WPF)

Scenario. ViewModel has a property State. View has a ComboBox that allows to change value of State. ViewModel needs to run some validation (call bool ValidateState(State value) method) before setting ...
1
vote
2answers
2k views

MVVM Correct way to switch between views occupying the same footprint on the screen

An example is switching the main view according to the selected item in a hamburger menu. Also sometimes it is just a small part of the GUI that changes according to the application state or according ...
1
vote
1answer
296 views

Is it right to have dependenties to my Viewmodel from data acces layer and view layer

Context In my application I use the MVVM pattern. I'll have a ViewModel that can contains information of a student. This viewmodel is used to communicatie between my view and model. I use ASP.net ...
0
votes
1answer
595 views

Duplicating Domain Model in View Model or not

I have an XML file that contains configuration information for a system. I can serialize/deserialize the XML into a hierarchy of objects that describe the configuration (and no more) and then pass ...
-1
votes
2answers
165 views

Should i be using My own MVVM implementation?

Hi there i've been into MvvM and modular design the last few days, i find it really nice design principle that be scaled and maintained really well. But here is the thing, i see there are multiple ...
2
votes
2answers
2k views

How to separate the ViewModel from the Model, yet associate them with each other based on the Model?

In a wpf application, a Model object is created either from scratch or deserialized from some .xml file. To create a connection to the ViewModel, the following method (on the Model!) is used by the ...
0
votes
0answers
54 views

How to share this kind of logic between view-models

Two view-models, each for a separate screen, have an ICommand which has same logic: it needs to choose between asking the user to choose from a list of items or choose an item automatically. How ...
3
votes
1answer
754 views

MVVM communicate between views

I know we can use the Mediator Pattern to communicate between view models but what about views? Lets assume I have a button in View A which should trigger functionality of View B. How is this ...
5
votes
1answer
441 views

MVVM Persistence from view model

I'm new to MVVM, I get the general idea, but there's one thing that I've been having a tough time finding an answer for. Inevitably an application will have a save button in the UI. The UI talks to ...
0
votes
0answers
42 views

MVVM/Xamarin implementing services that require other services

Currently, I have a xamarin app that has a database, web service and 2 other services to handle the logic between the database/web service and the ui. I'm trying to make it all async, and therefore I ...
0
votes
1answer
80 views

MV(X) Patterns: How much nesting is too much? Is not enough?

Posts may be smaller than they appear! Skip the bulleted list. Lemme Just Say... I know that this is going to be largely (entirely...) opinion-based. Everyone has their own approach, and their own ...
1
vote
1answer
131 views

WPF – Arrangable row of rectangles

I originally posted this on StackOverflow, but got the message that this was the correct forum for such a question. https://stackoverflow.com/questions/44077183/wpf-arrangable-row-of-rectangles. I am ...
0
votes
2answers
1k views

Distinguishing the differences between view model and service layer

First project trying to use MVVM and Xamarin Forms, so please be gentle; however, I am at a lost on how to differentiate between the logic that belongs in the view model and model/service layer. I am ...
2
votes
1answer
231 views

MVVM, example of use in iOS

I have a view controller with a mapview (Apple Map), on top of that there is a view with a button and a textfield. The view is compacted around the search button, when I touch it it expands revealing ...
0
votes
1answer
1k views

Multithreaded C# MVVM Application Architecture

I have an application built in C# using the MVVM pattern that will have 40-50 different tests that need to be run. I want to show each test as a list item with a progress bar of how far each test has ...
6
votes
2answers
491 views

Should I remove “everything” from my controller in MVVM?

I'm working with Xamarin and we are following the MVVM design pattern. For those who don't know what Xamarin is, it's a technology that allows us to build iOS and Android apps with shared code. ...
1
vote
1answer
86 views

If I have to check integrity of the strings coming from the View, where should I do it?

The scenario: I have a GUI with textfields and radio buttons where the user insert information for a 'Person' Here are the classes of the model and of the view-model: enum Gender { case Male, ...
-1
votes
1answer
1k views

Can MVVM architecture be used in designing web applications?

One of the client for whom I had worked has a MVVM architecture for web application.I dont know why they incorporated instead of MVC. is this a feasible idea because as far as I have gone through all ...
1
vote
2answers
613 views

Preserve MVVM while using XAML resources

Context: I'm creating a WPF application using MVVM. I have a Page which displays a status informing what task the app is performing on Background. I have a container, and bind its Content to an ...
1
vote
1answer
474 views

MVVM, is it better suited for web applications or GUIs?

I am currently deciding whether I should implement a new system with a web application as a front-end, or if I should instead produce an executable file using WPF. The pattern that I will use is MVVM,...
0
votes
1answer
1k views

Is MVVM the right choice for a single-developer WPF project?

I'm starting to design and develop a WPF application for my company and one of the first choices that I have to make is whether or not to use MVVM. The main points to consider are: The application ...
2
votes
1answer
1k views

When using MVVM, is it okay to use property injection on a view model in WPF?

I am rather new to the concept of MVVM in C#/.NET WPF projects. The way I understand it, the view-model is supposed to lessen the amount of code-behind required to display data on a form. I try to do ...
5
votes
2answers
147 views

Should I create a (new) project for shared UserControls?

Context: I'm creating some applications to help me on my daily tasks, it does not connect anywhere and the only "data" it has to deal with is the parameters that I enter on the input fields. This is ...
3
votes
1answer
368 views

MVVM Inheritance following SOLID principles

I'm currently at the design phase of my program (hence no code). It will be written in WPF in C# using MVVM principles. I'm going to have a multifunctional Drag & Drop control, that will act ...
5
votes
1answer
2k views

MVVM best practices with WPF client and WCF duplex service

I've been thinking about how to design my WPF application, which receives data from a WCF duplex service, but I'm afraid of over engineering. I thought about abstracting away the WCF communication ...
3
votes
1answer
323 views

CQRS: how granular should the queries be?

I have a system that uses CQRS with the Queries written using Dapper. It's worked out well, except that there has been a proliferation of query classes that do almost the same thing. The downside of ...
3
votes
2answers
575 views

State handling in WPF-MVVM

I am looking for advice on handling states in a WPF MVVM environment. As an example, assume we have A TreeView (or some other ItemsControl) with some items and a button that is enabled when an item ...