Questions tagged [mvvm]

Model-View-ViewModel (MVVM) is an architectural design pattern for implementing user interfaces that separates the UI (the View) from its data (the Model) via its presentation logic (its ViewModel).

Model-View-ViewModel (MVVM) is an architectural design pattern for implementation of user interfaces. Its primary focus is on separation of concern between the View (UI) and the Model (Data) by using an intermediate layer called a ViewModel to enhance manageability, scalability, and testability.

It is used in all based frameworks including , , ,,, the ZK framework and frameworks including KnockoutJS. Popular .Net frameworks implementing the pattern include:

See Also:

27679 questions
1362
votes
25 answers

What is the difference between MVC and MVVM?

Is there a difference between the standard "Model View Controller" pattern and Microsoft's Model/View/ViewModel pattern?
Bjorn Reppen
  • 20,343
  • 8
  • 51
  • 84
358
votes
14 answers

INotifyPropertyChanged vs. DependencyProperty in ViewModel

When implementing the ViewModel in a Model-View-ViewModel architecture WPF application there seem to be two major choices how to make it databindable. I have seen implementations that use DependencyProperty for properties the View is going to bind…
bitbonk
  • 45,662
  • 32
  • 173
  • 270
278
votes
5 answers

Vue.js—Difference between v-model and v-bind

I'm learning Vue with an online course and the instructor gave me an exercise to make an input text with a default value. I completed it using v-model but, the instructor chose v-bind:value and I don't understand why. Can someone give me a simple…
Gustavo Dias
  • 2,901
  • 2
  • 9
  • 6
269
votes
31 answers

How to bind to a PasswordBox in MVVM

I have come across a problem with binding to a PasswordBox. It seems it's a security risk but I am using the MVVM pattern so I wish to bypass this. I found some interesting code here (has anyone used this or something…
mark smith
  • 19,527
  • 44
  • 131
  • 185
254
votes
25 answers

How should the ViewModel close the form?

I'm trying to learn WPF and the MVVM problem, but have hit a snag. This question is similar but not quite the same as this one (handling-dialogs-in-wpf-with-mvvm)... I have a "Login" form written using the MVVM pattern. This form has a ViewModel…
Orion Edwards
  • 113,829
  • 60
  • 223
  • 307
250
votes
20 answers

Data binding to SelectedItem in a WPF Treeview

How can I retrieve the item that is selected in a WPF-treeview? I want to do this in XAML, because I want to bind it. You might think that it is SelectedItem but apparently that does not exist is readonly and therefore unusable. This is what I want…
Natrium
  • 29,076
  • 15
  • 55
  • 71
243
votes
22 answers

MVVM: Tutorial from start to finish?

I'm a C#/Windows Forms programmer with more than 5 years experience. I've been investigating WPF using the MVVM (Model-View-ViewModel) design pattern. I have searched the Internet for tutorials. I have even watched the entirety of Jason Dolinger's…
JP Richardson
  • 35,950
  • 34
  • 117
  • 150
239
votes
23 answers

Handling Dialogs in WPF with MVVM

In the MVVM pattern for WPF, handling dialogs is one of the more complex operations. As your view model does not know anything about the view, dialog communication can be interesting. I can expose an ICommand that when the view invokes it, a…
Ray Booysen
  • 25,338
  • 12
  • 77
  • 109
236
votes
13 answers

What framework for MVVM should I use?

I am developing an application with the MVVM model, but I have reached a point where I need to choose which framework to use. Among the possible options are: MVVM Toolkit MVVM Foundation WPF Application Framework (WAF) Light MVVM Caliburn…
Rangel
  • 2,643
  • 4
  • 16
  • 11
224
votes
5 answers

What is difference between MVC, MVP & MVVM design pattern in terms of coding c#

If we search Google using the phrase "differences between MVC, MVP & MVVM design pattern" then we may get a few URL's which discuss the difference between MVC MVP & MVVM design pattern theoretically like: MVP Use in situations where binding via a…
Thomas
  • 31,089
  • 118
  • 335
  • 589
202
votes
3 answers

AndroidViewModel vs ViewModel

With the introduction of the Android Architecture Components library, several new classes were introduced, including AndroidViewModel and ViewModel. However, I'm having trouble figuring out the difference between these two classes. The documentation…
201
votes
5 answers

KnockOutJS - Multiple ViewModels in a single View

I'm thinking that my application is getting quite large now, too large to handle each View with a single ViewModel. So I'm wondering how difficult it would be to create multiple ViewModels and load them all into a single View. With a note that I…
CLiown
  • 12,698
  • 45
  • 117
  • 194
198
votes
7 answers

Add directives from directive in AngularJS

I'm trying to build a directive that takes care of adding more directives to the element it is declared on. For example, I want to build a directive that takes care of adding datepicker, datepicker-language and ng-required="true". If I try to add…
193
votes
4 answers

Binding a WPF ComboBox to a custom list

I have a ComboBox that doesn't seem to update the SelectedItem/SelectedValue. The ComboBox ItemsSource is bound to a property on a ViewModel class that lists a bunch of RAS phonebook entries as a CollectionView. Then I've bound (at separate times)…
Geoff Bennett
  • 2,343
  • 2
  • 15
  • 13
182
votes
6 answers

[Vue warn]: Cannot find element

I'm using Vuejs. This is my markup:
This is my code: var main = new Vue({ el: '#main', data: { …
dopatraman
  • 11,801
  • 22
  • 74
  • 138
1
2 3
99 100