viewmodel

WPF Toolkit DataGrid MultiSelect with MVVM - Please Help

Hi, We're using the WPF DataGrid from the WPF Toolkit and are employing MVVM. I'm finding some challenges in using MultiSelect in MVVM and am sure that I'm just missing something simple. I can use the "IsSelected" in the ViewModel to get the event when selecting a row in the DataGrid. This works fine for a single selection. If I set "Se...

Silverlight behavior based on update of view model property

Hi, I'd like to have a Silverlight behavior that is triggered by a change to a property in the view model for my page. I can't figure out how to do this, however. So, I have a very simple view model: public class MyViewModel : INotifyPropertyChanged { private bool changingProperty; public bool ChangingProperty { ge...

WPF MasterDetail ViewModel delay updates to master list. (prevent grid from updating automatically)

First attempt at implementing MVVM pattern on line-of-business project. I am running into questions that I assume there are eaiser answers for like this one: Protype window is basic master-detail view of a list of items. (a list of Person objects). The view contains an Infragistics xamDataGrid for the master list. As the item is select...

ASP.NET MVC - Form Returns Null Model Unless Model is Wrapped in a Custom ViewModel

I have a pair of views in my application that both display the same Editor Template for one of my model items; of the two views ("Add" and "Edit"), "Edit" works fine, but "Add" is returning null for the model when my controller action handles the post. I found that if I give the "Add" view a custom ViewModel and call Html.EditorFor(p =>...

SilverLight - MVVM binding viewmodel property to datagrid column

In my SilverLight application, I have a property in my ViewModel called 'vmProperty' and a list called 'dgSource'. I bind my dgSource to the datagrid as ItemsSource at which point each datagrid row's datacontext changes to each item in dgSource. One of the columns, say a checkbox column, needs to bind to vmProperty. But since the ViewM...

WPF: how to signal an event from ViewModel to View without code in codebehind?

Hi, I have quite simple (I hope :)) problem: In MVVM, View usually listens on changes of ViewModel's properties. However, I would sometimes like to listen on event, so that, for example, View could start animation, or close window, when VM signals. Doing it via bool property with NotifyPropertyChanged (and starting animation only whe...

Is it a good idea to aggregate ViewModels in WPF

Is it a good\bad idea to have a ViewModel as property of another ViewModel? eg. public sealed class ContentManagerViewModel : ViewModel { public FindViewModel Find { get; set; } } Cheers AWC ...

asp.net mvc - setting meta tags & page title

Hi, I have my asp.net mvc project setup which passes strongly typed view models to every view using a BaseViewModel. The base view model includes information such as page title & meta tag information. Is there a fast & simple way to use this information from my ViewModel to set this information in my master page? At the moment i have ...

WPF - Is it a good idea to keep the ViewModel agnostic of WPF?

In the subject really, I want to know people's experience of trying to keep all WPF concerns out of ViewModels in WPF. Cheers AWC ...

WPF - Should a user control have it's own ViewModel?

I have a window made up of several user controls and was wondering should each user control have it's own ViewModel or should the window as a whole have only one ViewModel? Cheers AWC ...

MVVM ViewModel vs. MVC ViewModel

ViewModel is a term that is used in both MVVM (Model-View-ViewModel) and the recommended implementation for ASP.NET MVC. Researching "ViewModel" can be confusing given that each pattern uses the same term. What are the main differences between the MVC ViewModel and MVVM ViewModel? For example, I believe the MVVM ViewModel is more rich...

WPF - Should a user control be supplied with a ViewModel

I'm about to use a user control developed by a different team (in the same company) and for the app we're developing we're attempting to describe all the data binding in XAML. Now if I use a third party user control should I expect them to supply a basic ViewModel with hooks for my code or should I expect to write code to bind the user ...

Semi-colon expected... but there is one, any MVC.NETers can look at this?

Compiler Error Message: CS1002: ; expected Source Error: Line 56: </div><!--end #Asset--> Line 57: Line 58: <% KODmvc.Models.AssetRatingViewModel ratingModel = ViewData["RatingViewModel"] as KODmvc.Models.AssetRatingViewModel(); %> Line 59: <% Html.RenderPartial("RatingView", ratingModel); %> Line 60: Source Fil...

Improving MVC usage

I'm busy building an MVC application in PHP using Kohana MVC framework, and it works very well. But there are some small annoyances which I'd like to address. A lot of logic is repeated across actions in controllers and controllers themselves. I've been thinking about it, and I thought it would be smart to define an object which contain...

C# MVC ViewModel Property OrderBy Exception

I have a collection of ViewModel objects that I am attempting to sort. This is an abbreviated view of my ViewModel class: public class BookIndexFormViewModel { //Properties public Book Book { get; set; } //Constructor public BookIndexFormViewModel(Book book) { Book = book; } Thi...

DTO = ViewModel?

I'm using NHibernate to persist my domain objects. To keep things simple I'm using an ASP.NET MVC project as both my presentation layer, and my service layer. I want to return my domain objects in XML from my controller classes. After reading some posts here on StackOverflow I gather DTOs are the way to go. However, I've also come acros...

MVVM (with WPF) - Binding Multiple Views to the Same ViewModel

I have recently started investigating the MVVM pattern with WPF for an upcoming project. I started with Josh Smith's MSDN article. I have a question (well many, but let's start with one): I have an IndividualViewModel which exposes the properties of the model. I need two views "Add Individual" and "Edit Individual" which are very simila...

asp.net mvc strongly typed view model with multiselect

Hi, I would like to know how i can bind my form values to my strongly typed view from a MultiSelect box. Obviously when the form submits the multi-select box will submit a delittemered string of my values selected...what is the best way to convert this string of values back into a list of objects to attach to my model to be updated? p...

How to handle view model with multiple aggregate roots?

At the moment, i got quite badly fashioned view model. Classes looks like this=> public class AccountActionsForm { public Reader Reader { get; set; } //something... } Problem is that Reader type comes from domain model (violation of SRP). Basically, i'm looking for design tips (i.e. is it a good idea to spli...

Resources for implementing MVVM (ViewModel) pattern in Flex?

Can anyone direct me towards some code or a tutorial for implementing the ViewModel in Flex 3? All I'm finding on the web are examples for Silverlight. ...