Binding child usercontrol to datacontext of parent

Nov 15, 2010 at 8:21 PM

I'm trying to create a reusable child control that inherits its data context from its parent yet still uses CM conventions to wire up the bindings. It's not clear to me how to do this (if it's even possible). Any pointers? 

The scenario is a "status" panel that includes things like a Loading message, error message, or a status message. The View is reusable in that case, but the data source should be the ViewModel of the parent control. 

Nov 15, 2010 at 9:40 PM

Have you tried this?

<Parent ...>
   <StatusPanel cal:Bind.Model="{Binding}" />

Nov 16, 2010 at 1:42 AM

That worked! Thanks Rob!