Child ViewModels?

Child ViewModels?

Old forum URL: forums.lhotka.net/forums/t/11940.aspx


JonM posted on Thursday, April 18, 2013

I'm working with WPF and CSLA.net 4.5.  I've got a editable root > editable child > editable child list > editable.  I've got my MVVM pattern working, using the simple Bxf framework.  So I need to show a different UI/View for the editable child list.  That all works.  How do I get data back from the editable list into my my root VM?  Once I do a ShowView I've lost the handle to it.  So I do I return to it with my editable child list?  Any ideas?  Is there a pattern for this?  I was thinking of passing my root vm into the child vm.  That way when I close the child view I can call show view with the original VM.

edore replied on Friday, April 19, 2013

Hi!

I don't use Bxf but I prefer to use a loose messaging system.  With Prism there is the EventAggregator, which I use extensively.  I strongly encourage you to decouple your view models instead of coupling them.

Good luck!

Etienne

Copyright (c) Marimer LLC