Hi Miguel, Thanks for that; that is the approach I will take.
Regards, Tony On Mon, Jan 25th, 2010 at 2:49 PM, Miguel Madero <[email protected]> wrote: > As I mentioned in the other thread, I would try to avoid accessing > other > View's ViewModel. There're other ways of communicating them. Caliburn > has > this cool concepts of Child ViewModels with really weird names, so > the > dependencies occur at the ViewModel level, Prism has the Event > Agrregator, > Ninject has the Message Broker (which does exactly the same that the > EA), > you might have a Controller that takes care of passing those > dependencies. > In a master detail scenario your UserControl might just need access > to one > of the properties of the parent's ViewModel (which might be a > ChildViewModel). If that's the case you could bind the DataContext of > the > child to one of the properties of the ViewModel. > > <ChildControl > DataContext={Binding OtherProperty}/> > > If you want to share the same DataContext (e.g. the ParentViewModel), > you > don't need to do anything. See the attached example. I'm setting the > DataContext in the parent and the children will inherit it. The > TextBox is > using Binding this time to get the property and on the Loaded event > I've > access to it from codebehind. > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com (blog) > [email protected] > _______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
