Simple View Model Communication

With using "View Model Style" programming, it may be a little confusing as to how you can communicate between View Models. There are various methods available, but this article explores what I hope to be an easy simple method.

View Model Style

View Model Style allows a programmer to create an application that has absolutely no UI (user interface). The programmer only creates a View Model and a Model. A designer with no programming ability at all, is then able to start with a blank page and completely create the View (UI) in Microsoft Expression Blend 4 (or higher). If you are new to View Model Style, it is suggested that you read Silverlight View Model Style : An (Overly) Simplified Explanation for an introduction.

The Child Application

First, we will create a Silverlight Application that will be the Child Application. We use the following code for the View Model:

I agree with you "defwebserver", I too have been coding a long time in virtually every language that has existed and I don't entirely agree with a couple of the newer standards. Common sense is always the best approach,...with a strong emphasis on the current standards.
I have found that those who have mainly worked in one particular language, be it C, Java, T-SQL etc, tend to have the least flexible and in my opinion poor approach to standards.

The only comment I have as to your conventions is that there is no need to prefix to identify the object type (Hungarian notation), as this is so easily determinable these days in EDIs and general structure of code streams. Also, the introduction of "var" makes Hungarian notation meaningless anyway.

In .NET (C#) I think naming variables can be done in this manner for clarity for yourself and anybody maintaining the code....local variable name with camel case, an associated private class level variable with an "_", and and associated public property capitalised at the start to be extremely effective, even if the accepted standard is not to use "_".

You can also get a very nasty bug if you set your get and set properties wrong, and so I find the "_" helps extremely in preventing this bug - it is obvious you are returning the private member, not the public Property.

I've been passing the UserControl as an ICommand parameter invoked when LayoutRoot loads, then extracting the DataContext in the MainViewModel and casting it to the UserControl ViewModel. What a kludge that turns out to be!!