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:

29966 questions
24 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
  • 22,007
  • 9
  • 64
  • 88
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…
  • 48,890
  • 37
  • 186
  • 278
32 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
  • 20,637
  • 47
  • 135
  • 187
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
  • 121,657
  • 64
  • 239
  • 328
21 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…
  • 30,772
  • 17
  • 59
  • 73
4 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…
24 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
  • 28,894
  • 13
  • 84
  • 111
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
  • 38,609
  • 36
  • 119
  • 151
6 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…
  • 33,544
  • 126
  • 357
  • 626
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…
  • 2,673
  • 4
  • 18
  • 11
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,513
  • 2
  • 16
  • 13
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: { …
  • 13,416
  • 29
  • 90
  • 154
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…
  • 13,665
  • 48
  • 124
  • 205
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…
20 answers

How to get Context in Android MVVM ViewModel

I am trying to implement MVVM pattern in my android app. I have read that ViewModels should contain no android specific code (to make testing easier), however I need to use context for various things (getting resources from xml, initializing…
Vincent Williams
  • 2,836
  • 3
  • 17
  • 22
2 3
99 100