Questions tagged [mvvm]
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.
228
questions
0
votes
2answers
3k views
Model and ViewModel for View
I am new to the MVVM pattern. I have a window which has 3 text boxes (Name, Address, Description), a save button, and a listview which displays the above fields. When the save button is clicked I want ...
2
votes
2answers
1k views
I know the language but still can't code like other peers [closed]
I have moved to a new job and code base (been doing C#, .NET, Windows Forms, etc. for last four years) and I have been on this for three months until today. During these three months I caught up with ...
1
vote
1answer
1k views
Where does non-MVVM code belong in an MVVM app?
By non-MVVM code, I mean things like highly generalized components, like one with common extension methods for CLR types, and other 'homeless' helper classes etc? I have a Core project that most ...
4
votes
3answers
3k views
Should IoC container be part of portable library?
I am seeing the benefits of Portable Class Libraries for centralizing Models and ViewModels to a single code-base. Where should dependency injection management (IoC container) take place, though? My ...
6
votes
1answer
1k 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. ...
18
votes
2answers
12k 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 ...
3
votes
1answer
173 views
When is it okay to reassign the model for a view in MVC?
Is it ever really acceptable to reassign the model for a view in MVC? (Or MV* where applicable.) In other words, for a single view instance, is it ever ok to reassign the view's model? That is, as ...
1
vote
1answer
720 views
What shoud MainWindow of a WPF contains
I am making a WPF application following MVVM model. I have seen some approaches for applying MVVM. I am concerned about my MainWindow.xaml. In some tutorials I have seen that MainWindow is only ...
1
vote
1answer
761 views
Syncing objects from code with the view in WPF
I've been reading some into it, but I am time pressed, so I would require a simple solution now and I promise to read up on it later. I come from a winforms c# background, and have lately been working ...
5
votes
2answers
6k 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 ...
12
votes
3answers
13k views
MVVM and service pattern
I'm building a WPF application using the MVVM pattern. Right now, my viewmodels calls the service layer to retrieve models (how is not relevant to the viewmodel) and convert them to viewmodels. I'm ...
2
votes
1answer
474 views
Sub routing in a SPA site
I have a SPA site that I'm working on, I have a requirement that you can have subroutes for a page view model. Im currently using this 'pattern' for the site
MyApp.FooViewModel = MyApp.define({
...
9
votes
3answers
27k views
What the best way to wire up Entity Framework database context (model) to ViewModel in MVVM WPF?
As in the question above: What the best way to wire up Entity Framework database model (context) to viewModel in MVVM (WPF)?
I am learning MVVM pattern in WPF, alot of examples shows how to implement ...
5
votes
3answers
2k 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 _model....
2
votes
3answers
4k views
MVVM application architecture, where to put dependency injection configuration class, BusinessLayer and Common interfaces?
Planning my architecture for an MVVM application I come to this:
MyApp.UI
View
MyApp.BusinessLayer
ViewModel
MyApp.DataAccessLayer
RepositoryImplEF
MyApp.DomainLayer
DomainObject
...
-1
votes
1answer
458 views
Converting between data and presentation types
I'm quite new to stuff like DI, MVVM and WPF altogether, so it's fairly possible this reads like a giant WTF...
I have defined an interface in my business layer, ISomeEntity; then in my data layer, I ...
7
votes
4answers
2k views
Clean, Modular Code vs MV* Frameworks [closed]
I've been hearing a lot about the "new" MV* frameworks. I've tinkered with KnockoutJS (I created an invoicing application), but I much prefer to write clean, modular code in raw JavaScript - ...
7
votes
5answers
20k views
MVVM ViewModel and Commands
I need a bit of help to understand the relationship between a viewmodel and a command, and the responsibility of the viewmodel.
I'll try to give an example (using Caliburn Micro).
I have a viewmodel ...
5
votes
2answers
2k views
Should Item Grouping/Filter be in the ViewModel or View layer?
I'm in a situation where I have a list of items that need to be displayed depending on their properties. What I'm unsure of is where is the best place to put the filtering/grouping logic of the ...
0
votes
2answers
7k views
MVVM pattern - Best design approach to manage an application
One year ago, I discovered the WPF technology and I developed a little application, as first experiment, to compare the content of two different directories. The content of each directory is shown in ...
9
votes
1answer
2k views
Value of MVVM in a Line of Business Application (and a Rant of Current Development Practices)
After 2 years, I'm still struggling with MVVM as a practical method of producing working software. In some cases it's great. I did a multithreaded application that controlled a small assembly line ...
18
votes
2answers
14k 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 ...
1
vote
1answer
766 views
Checklist for coding MVVM web application [duplicate]
We are a small team working on a web application using MVVM design pattern using technologies like .NET, Knockout and HTML. I am trying to come up with a code review checklist for this, so that my ...
1
vote
2answers
220 views
Why DependencyProperties and not native language support?
With advent of WPF and MVVM Microsoft introduced DependencyProperties and INotifyPropertyChange interface to provide a way to implement the "reactive" approach used with those technologies.
Sadly ...
4
votes
2answers
790 views
Should MVVM ViewModel inject an HTML template for default view?
I'm working on web application design that includes Knockout.js and have an overall MVVM question: Does it make sense for the ViewModel to automatically inject a default HTML template (pulled from ...
0
votes
2answers
294 views
What is this variation of MVC in JavaScript?
I am working on sorting out my Javascript code. Currently I have views implemented without any Model or collection. Now I working on separating Model from View. So for this transformation, I am ...
1
vote
2answers
2k 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 ...
14
votes
3answers
7k views
MVVM Clarification
We are about to write our first WPF application and are becoming familiar with the MVVM pattern. We've built many Winform applications and have an architecture that has been very successful for us. ...
7
votes
4answers
15k views
How to organize MVVM files in solution
I'm fairly new to the MVVM concept but like a lot of the flexibility it gives me so far. However, I'm struggling to find a good way to manage my code. I have several classes that are just sitting in ...
4
votes
2answers
956 views
WCF service as a proxy for publishing real-time data to a WPF/MVVM clients
I've been tasked with creating a dashboard application to show real time updates for our servers. The raw data comes in from an XML file on our intranet which I need to parse and present to the user.
...
1
vote
1answer
108 views
For a front-end application broken down in a MV* manner, should I have models dedicated to UI logic?
I am not talking about simple UI logic like clicking a button directs you to another page, but where one action may result in several different of behavior depending on current application state, and ...
4
votes
1answer
1k views
Distinguishing between UI command & domain commands
I am building a WPF client application using the MVVM pattern that provides an interface on top of an existing set of business logic residing in a library which is shared with other applications. The ...
2
votes
1answer
2k views
What is the good way of sharing specific data between ViewModels
We have IAppContext which is injected into ViewModel.
This service contains shared data: global filters and other application wide properties.
But there are cases when data is very specific. For ...
5
votes
1answer
954 views
Are all View Models supposed to be accessed through the Main View Model in MVVM?
I am currently working on a WP8 application. My current design is to have each view bind against a specific view model directly.
Looking through the samples though, it seems that another way is to ...
2
votes
1answer
964 views
Is there a clean separation of my layers with this attempt at Domain Driven Design in XAML and C#
I'm working on an application. I'm using a mixture of TDD and DDD. I'm working hard to separate the layers of my application and that is where my question comes in.
My solution is laid out as ...
4
votes
2answers
5k views
Hierarchical View/ViewModel/Presenters in MVPVM
I've been working with MVVM for a while, but I've recently started using MVPVM and I want to know how to create hierarchial View/ViewModel/Presenter app using this pattern.
In MVVM I would typically ...
2
votes
3answers
2k views
How do I know if I'm violating MVVM with WPF? [closed]
I was recently grabbing an auto generated TreeViewItem from a nested TreeView node in WPF, and I was using ItemContainerGenerator to get it in code behind. Then I thought to myself I'm certainly ...
17
votes
5answers
24k views
How to make creating viewmodels at runtime less painful
I apologize for the long question, it reads a bit as a rant, but I promise it's not! I've summarized my question(s) below
In the MVC world, things are straightforward. The Model has state, the View ...
5
votes
1answer
300 views
Contract / Project / Line-Item hierarchy design considerations
We currently have an application that allows users to create a Contract. A contract can have 1 or more Project. A project can have 0 or more sub-projects (which can have their own sub-projects, and so ...
5
votes
3answers
3k views
MVVM - child windows and data contexts
Should a child window have it's own data context (View-Model) or use the data context of the parent? More broadly, should each View have its own View-Model? Are there are any rules to guide making ...
6
votes
1answer
5k views
WPF, MVVM, EF, POCO guidance required on simple architecture
(sorry for my poor english)
I am developing a application using WPF, EF Code First using MVVM (Caliburn.Micro).
It should be used mostly to CRUD work. I created a BaseViewModel<T> class from ...
17
votes
3answers
11k views
MVVM, DDD, and WPF Layered Application Project Structure Guidance
I am trying to setup my application's structure in VS and I want to "try" and future proof it to a reasonable level. This application will be a WPF re-write of an old Winform app that had followed no ...
1
vote
1answer
157 views
Add complex customization to form or create two forms?
I'm working in a WPF application that both imports and exports delimited text files. At both ends, there is a UserControl which encapsulates some logic about delimiter configuration. It has some ...
6
votes
2answers
599 views
Given the presentation model pattern, is the view, presentation model, or model responsible for adding child views to an existing view at runtime?
I am building a Flex 4 based application using the presentation model design pattern. This application will have several different components to it as shown in the image below.
The MainView and ...
5
votes
1answer
631 views
wizard-like data collection implementation help (next, next, finish)
I'm beginning to build an interface for our field techs to close out work orders and we have many different required paper forms for different customers. I had hoped to build a system where i can set ...
2
votes
1answer
125 views
How to verify the client's view is consistent with the remote model?
i'm designing a client-server system via web broswser and i have this problem:
I send the data to the client via JSON, then the javascript view shows the stuff. Then the user takes actions and ...
4
votes
1answer
199 views
What conventions or frameworks exist for MVVM in Perl?
We're using Catalyst to render lots of webforms in what will become a large application. I don't like the way all the form data is confusingly into a big hash in the Controller, before being passed to ...
6
votes
1answer
4k views
Which notification pattern is preferable?
I'm working on a view model for a view that presents a dialog with export options. The user selects options then clicks Export. When the view model completes the Export, the calling view model ...
1
vote
1answer
385 views
Need suggestion for Mutiple Windows application design
This was previously posted in StackOverflow, I just moved to here...
I am using VS2008, MVVM, WPF, Prism to make a mutiple window CRM Application.
I am using MidWinow in my MainWindow, I want
Any ...
1
vote
2answers
2k views
Creating controls dynamically in the code-behind or ViewModel?
Right now I'm working migrating an app I made entirely using code behind to MVVM and had a question on where I'm supposed to be creating controls dynamically.
Basically I have a web service that ...