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
7
votes
4 answers

MVVM with WPF using LINQtoSQL in a DAL along with a BLL

My goal is to have an app that is using WPF and is a 3 tier architecture. UI, BLL, and DAL...I'd like to use the MVVM but I'm not sure how that works with a 3 tier architecture or if it is something entirely different. So with that in mind, I have a…
Mike
  • 1,349
  • 1
  • 17
  • 23
7
votes
3 answers

DependencyProperty Registration in ViewModel

I am finding a lot of discussions about ViewModels and their Properties that compare two approches: implementation of INotifyPropertyChanged or implementation via Dependency Properties. While I am doing INotifyPropertyChanged a lot (and it's…
joerg
  • 717
  • 2
  • 8
  • 18
7
votes
6 answers

Bi-directional view model syncing with "live" collections and properties

I am getting my knickers in a twist recently about View Models (VM). Just like this guy I have come to the conclusion that the collections I need to expose on my VM typically contain a different type to the collections exposed on my business…
Jack Ukleja
  • 13,061
  • 11
  • 72
  • 113
7
votes
1 answer

Knockout JS Calling a ViewModel function inside a foreach binding

Let's consider a view model using knockout like that: var data = [{ id: 1, name: "John Doe" }, { id: 2, name: ""}, { id: 3, name: "Peter Parker"}]; var viewModel = { items: ko.observableArray(data) }; viewModel.showName = function (name) { …
7
votes
1 answer

Nested ObservableCollection - Propogate notification from child to parent

I'm developing a WPF application with MVVM Light Toolkit. I just want to display a nested Observablecollection which hold the Employee Attendance details into a DataGrid and do some CRUD functionality in the inner grid and based on those changes I…
Dennis Jose
  • 1,589
  • 15
  • 35
7
votes
1 answer

Kendo UI MVVM - How to get the opposite or NOT or ! of a binary variable when data-binding

What I want to do is this: viewModel = kendo.observable({ editable: false }); But I get the error: Uncaught…
Sam
  • 125
  • 4
  • 7
7
votes
7 answers

WPF ComboBox SelectedItem

Ok been working with WPF for a while but I need some help. I have a ComboBox like below:
Jose
  • 10,891
  • 19
  • 67
  • 89
7
votes
1 answer

WPF XAML Parse Exception occured Error?

TheSpy
  • 265
  • 1
  • 8
  • 21
7
votes
6 answers

Collapse all the expanders and expand one of them by default

I have multiple expanders, and I was looking for a way to collapse all others the expanders when one of them is expanded. And I found this solution here XAML:
Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
7
votes
2 answers

Handling user settings with MVVM

Currently i'm developing an WPF application with the MVVM-light framework. On this moment i'm setting my settings as shown in the next example code in my viewmodel: private string _property public string Property { get { return _property; } …
Jim
  • 2,974
  • 2
  • 19
  • 29
7
votes
3 answers

What's the best way to pass event to ViewModel?

The case is: I have a control's event that I want my ViewModel to react on. Currently I'm doing this by executing a command of invisible button like in the example below. In View.xaml:
Kurtevich
  • 345
  • 8
  • 18
7
votes
4 answers

UI Threading with ViewModels

Collections that are bound in a WPF View must be updated on the UI thread. ViewModel exposes a collection Therefore when collection in the ViewModel is modified it must be done in the UI thread Best practice is to keep ViewModels ignorant of View…
Jack Ukleja
  • 13,061
  • 11
  • 72
  • 113
7
votes
2 answers

Displaying read only properties in PropertyGrid control

I am using the WPF Extended Toolkit to display the properties of a Team object. Now one of these properties is a collection Persons. No problem I get a nice drop down, which when I click on shows me the names and ages of each of these people. Now…
openshac
  • 4,966
  • 5
  • 46
  • 77
7
votes
1 answer

WPF button click and command doesn't work together MVVM

I'm developing some wpf application, using mvvm. I'm trying to use button click event and command together but command never get executed. Also when I use only command without click event it works perfect. Here is the code:
Stojdza
  • 445
  • 2
  • 10
  • 32
7
votes
1 answer

Binding a function to the MouseDown event in xaml?

im Working on learning WPF and C# programming at the moment but im struggling with understanding bindings etc. I am stuck on "binding" functions or commands to my XAML object which is in a grid.
Martin
  • 180
  • 1
  • 4
  • 13
1 2 3
99
100