Multiple ViewModels in view

Nov 17, 2011 at 4:23 PM

Hi - I have a a view that allows editing of 2 grids and therefore has 2 save, reject buttons etc. I would ideally like to use a seperate viewmodel for each grid so as to cut down on the amount of code in a single viewmodel and serviceagent.  I have seen examples where people have created a MasterViewModel which has multiple public properties that hold other view models. However, I have not had much succeess in implementing that with simplemvvm. Can anybody help? Thanks

Coordinator
Nov 21, 2011 at 11:58 AM

It's entirely possible to have multiple "child" ViewModels that are consumed by a "parent" ViewModel.  What problems are you having?

Tony

Nov 21, 2011 at 1:00 PM
Thanks for your reply Tony. I think I was being lazy and hoping that there was an example of how to do this - thats what happens when you are so generous with all the other documentation :)

I am not sure what I need to put into the Xaml and how the parent can then talk to the child (to give it a selected Item value for example). Also whether the child needs to go in the locator - to set it up with a service agent.

I understand that I should probably spend some more time attempting this so that I can be more specific on the help I need.

Thanks,
Chris







On 21 November 2011 12:58, tonysneed <notifications@codeplex.com> wrote:

From: tonysneed

It's entirely possible to have multiple "child" ViewModels that are consumed by a "parent" ViewModel. What problems are you having?

Tony

Read the full discussion online.

To add a post to this discussion, reply to this email (simplemvvmtoolkit@discussions.codeplex.com)

To start a new discussion for this project, email simplemvvmtoolkit@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com