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
1 answer

Nested Listbox how to set parent listbox selectedItem on child listbox mouse double click

I have a Nested ListBox. On inner listbox mouse double click event, I need to open a new window based on some logic and for that I need the inner ListBox SelectedItem and its corresponding Outer ListBox SelectedItem. How can get this in an MVVM…
Dennis Jose
  • 1,589
  • 15
  • 35
7
votes
2 answers

How to Add a New Row to DataGrid in MVVM Friendly Way

I have the following DataGrid
MoonKnight
  • 23,214
  • 40
  • 145
  • 277
7
votes
5 answers

A better way to write MVVM boilerplate code?

I have found myself recently writing a lot of boilerplate MVVM code and wonder if there is a fancy way to get around writing it all? I already use a ViewModelBase class that implements INotifyPropertyChanged but that doesnt solve the problem of…
Chris
  • 26,744
  • 48
  • 193
  • 345
7
votes
1 answer

Pass KeyEventArgs to ViewModel from View in WPF (MVVM)

I have a textbox and I am trying to pass KeyEventArgs from view to viewmodel .But I do not know how to implement it. Basically what I need is if some special character is typed then some function is to be called if normal text( like A,B,C..etc) are…
7
votes
2 answers

WPF with MVVM and DataAnnotations, Validation Errors in a UserControl

I have a UserControl that will be reused throughout an application we are developing. We are using a framework based on MVVMLight. For the sake of simplicity lets say the user control contains only one textbox and exposes one dependency property…
thornhill
  • 632
  • 7
  • 17
7
votes
1 answer

Animation with MVVM pattern

What is the best way to trigger an animation while using the MVVM pattern? More specifically, I have a form which has several fields. When a user click's the save Button, I would like to show an animation. I have been able to achieve this by…
Pavel
  • 652
  • 7
  • 12
7
votes
5 answers

How should I communicate between ViewModels?

I am using MVVM Light and have used the packaged messenger system to communicate between view models, however I have hit a bit of a dilemma! Basically when a user clicks on a customer record the corresponding view is opened and with it the…
Sam
  • 586
  • 1
  • 6
  • 25
7
votes
1 answer

Pass KeyUp as parameter WPF Command Binding Text Box

I've a Text box KeyUp Event Trigger Wired up to a command in WPF. I need to pass the actual key that was pressed as a command parameter. The command executes fine, but the code that handles it needs to know the actual key that was pressed (remember…
DermFrench
  • 3,968
  • 13
  • 43
  • 70
7
votes
1 answer

Windows Phone 8 - MVVM ViewModels and App.xaml.cs

I've been studying the MVVM pattern and putting it into practice in a Windows Phone 8 app, and I have a question about the best practices for initializing and accessing ViewModels in an app. When I create a Databound Application from the WP8 SDKs…
miguelarcilla
  • 1,426
  • 1
  • 20
  • 38
7
votes
4 answers

BindingExpression path errors when switching ViewModels in MVVM application

First things first, some context. If you're familiar with the problem, skip down to the BindingExpression part. This is my first major project in WPF, so I am still quite new to the MVVM pattern. Here is the only other similar question I have found,…
Will Faithfull
  • 1,868
  • 13
  • 20
7
votes
2 answers

Best Way to Pass Data to new ViewModel when it is initiated

I am working on an WPF database application using the MVVM-Light Framework. I am using SimpleIOC to inject my Data Services, and my ViewModels are connected to the view from the XAML file. However, when opening new View Models I usually also need…
Daryl Behrens
  • 643
  • 2
  • 7
  • 19
7
votes
2 answers

How to get selected item in MVVM-WPF

Hi I am using WPF and MVVM, There is "Edit/Update" Panel in my application it updates selected data in Grid. It is working fine. I want to add one button "Close Button" and "one check to see whether user has selected item or not. If he doesn't…
Zoya Sheikh
  • 871
  • 3
  • 11
  • 21
7
votes
4 answers

Binding to a single element inside a CompositeCollection

I am trying to produce a list of servers for browsing on a network such that it produces a tree view which looks like this: -Local Server - Endpoint 1 - Endpoint 2 -Remote - - Remote Server 1 - Endpoint 1 …
MojoFilter
  • 12,256
  • 14
  • 53
  • 61
7
votes
4 answers

is it a good idea that the view model implements the IDataErrorInfo for validation?

i have an application that use the MVVM pattern and I would like to implement validation when the user is fill the information. I would like to use the IDataErrorInfo, but I don't know if it is a good idea that my view model implements that…
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
7
votes
3 answers

silverlight - communicate between 2 view models in MVVM using commands

i am working on MVVM and using commanding in silverlight(DelegateEvent and ICommand) I want something like this ,(say) i have 2 usercontrols , parent and child . Parent is hosting the child , both have thier own viewmodels . On parent i have a…
AB.
  • 282
  • 5
  • 11
1 2 3
99
100