Nested views properties do not auto update

Feb 7, 2012 at 11:38 AM

Hello

We want to use several smaller views into a container view (to reuse some views).
We pass along the object through the view by setting the datacontext and we set in to a public property in the child view.
We thought that the binding would auto update: say we change a string value in the container view, we want to see those changes in the childview as well.

This is not happening here. I would provide some XAML/code to show how we do it, but this insert code functionality seems to be broken (in both IE and Chrome).

I do have a small application in which I've reproduced the issue, could that be of any help for you to understand the problem?

Coordinator
Feb 7, 2012 at 11:59 AM

The child views get a custom view model, thus cannot inherit anything from their parent (except the model which is injected via binding like you do by binding the DataContext).

You have 2 options here:

1) Use the InterestedIn attribute (see http://catel.catenalogic.com/index.html?creating_a_view_model_that_wat.htm)

2) Use the MessageMediator to publish events that are required for multiple views (see http://catel.catenalogic.com/index.html?message_mediator.htm)

If that is not exactly what you mean, please e-mail the sample to me so I can take a look.