mvvm

adding rows dynamically based on the records in database in listbox mvvm mvvm light

Hi, I have a listbox in which I am displaying the records from the database. Its coming one after the other in a single column. How to put the records programitically as 3 rows and 3 columns i.e. 3 records in a row, after that 3 records in a row. Kindly suggest? Thanks. ...

Help on WPF Databinding to ViewModel Property (Prism)

Greetings guys, hopefully somebody has fresher eyes and can help me pinpoint the problem here, I'm trying to create a small app with prism and the MVVM pattern, everything was working nicely up to this point, my commands are firing properly with the argument, however, the TextBlock here is not binding to the CurrentUserKey property from ...

WPF MVVM - Repository pattern query

I have a web service which provides an interface to query data. I am writing a WPF application using MVVM. I am working on creating a repository that my View Models can use to retrieve models. The repository will call the Web service to fetch data, when required. I would require various Find methods in my repository that finds the data ...

Siliverlight databound combobox doesn't display initialized value

I am databinding a view to a viewmodel and am having trouble initializing a combobox to a default value. A simplification of the class I'm using in the binding is public class LanguageDetails { public string Code { get; set; } public string Name { get; set; } public string EnglishName { get; set; } public string DisplayName {...

WP7 - ViewModel Unit Testing

I had a unit test project for my windows phone 7 app ViewModels using the April Tools Refresh and everything worked fine. I just updated to the beta tools and now I can't get the test project to add a reference to nunit. The error I receive is "Reference can not be added because it was not built using the Windows Phone runtime. Win...

Loosely Coupled Intra-View Model Notifications w/Veto Option

Hello, In the application I'm building, the user may perform something in one view (backed by a view model) that should trigger an action in one or more other view models. Each of these other vms needs the ability to veto (a.k.a. cancel) the action performed in the first v/vm pair. Example: User clicks on an account in a DataGrid co...

MVVM like wizard

Hi, I am currently building an MVVM based application. The application should also have a wizard in MVVM style. The wizard is not a normal wizard, its a particular kind of a wizard. My goal is to implement a wizard with 1.) has also multiple branches. The wizard can guide you in other direction. So the wizard must not be straightforwar...

Caliburn - PropertyChanged for child ViewModel

I'm using Caliburn and the MVVM pattern in a WPF application, and am trying to use as many conventions as possible. One issue I'm running into is when I have to wire-up some property-changed notifications on an imported class. Say I have a ViewModel like so: class ViewModelA { private readonly IViewModelB _b; public ViewModel...

WPF DataGrid different edit controls within a single column

I am developing a WPF 4.0 application where I need to make a grid that contains a column with either textbox or a dropdown depending on the row. Example: | Name | Value | Help | | PROP1A | [textbox] | Description of prop1a | | Prop2A | [dropd...

wpf/silverlight mvvm sample app request

could you guys point me to some really simple silverlight or wpf sample project where the usage of the MVVM is showed ...

Finding a Control e.g. Label and assign its Content at runtime mvvm wpf

Hi, We have one xaml file in our Skins folder where designer has developed some styles for the labels,radiobuttons or checkboxes. I need to find the control, Label in this xaml file and assign the content property at runtime in virewModel so that it can automatically displays the content as per the records in the database. How to achiev...

MVVM light datagrid loading from two relational database tables

How to Load DataGrid with two related tables using MVVM light, I am using .NET RIA and silverlight 4. for example if my data tables are: userInfo- userID, Name, AddressID Address - AddressID, StreetName, Zip how can i create datagrid that displays [Name, StreetName, ZIp] ...

Yet Another MVVM question... Is my understanding correct?

Sorry if this is a duplicate, It's not so much 'What is MVVM' though, but rather, 'Is this MVVM', I've read quite a bit, and think I've got a basic understanding of what it is, I've got my own 'one-liner', as such, on how I interpret it, but want to make sure it's correct before I firmly ingrain it in my head, Essentially; The Model is ...

Why do I need MVVM for WPF/Silverlight, is there any good reason one cant use MVC?

Maybe I'm crazy, but I get MVC. It makes sense. MVVM seems like a way to make MVC harder, am I wrong (if so, why?)? ...

Multiple "sibling" controls, one-at-a-time visible, MVVM

I've got what I think is a fairly simple problem in Silverlight, and I'd like to solve it using MVVM principles, largely as a way of enhancing my own understanding. Let's say I have a simple LOB app that's designed to let me load up and edit a single Employee (just an example, for the sake of explanation). In my example, Employee is mad...

WPF MVVM: how to create & show a context menu?

For my WPF application I'm using MVVM, and now I want to show a generated context menu when the user right-clicks on something. Routing the right-click to some action was easy, but how do I show a contextmenu which items are generated by the ViewModel? I don't even have an idea where to start to display a context menu, since I do not ha...

Binding to ViewModel from XAML

Hi there, I am new to the MVVM model, so I would like some advice, the solution I'm using right now does not seem to work. Description: I have a Viewmodel containing an observablecollection of Customers, I display these in a grid with "Back" and "Forward" buttons. The grids datacontext is set to the SelectedCustomer which is a prope...

Can assign value to a property on property changed event ?

hI, I am working in wpf - mvvm model. I have a textbox which holds- "marketName". In xaml I am binding the property - "newmarketname"(which is defined in my viewmodel) to this textbox. Once if user enter a new market name in that text box, the "set" method of the "newmarketname" get called. In set method of the "newmarketname", I cal...

WPF - Dialogs using MVVM

Hi! When using custom dialog windows in a MVVM application, do you think it´s Ok to use the code behind to handle properties, events etc.? Or should I always have a ViewModel binded to every dialog view? What´s your thought? ...

Can't bind ICommand in VM to button Command in xaml

I create a VM based on MVVM light toolkit. In VM, there is a simple ICommand(RelayCommand) private RelayCommand _myCommand = null; public RelayCommand MyCommand { get { if (_myCommand == null) //set break point here for debug { _myCommand = new RelayCommand(() => ...