Refresh Bindings between view and view model

Topics: Questions
Nov 6, 2012 at 2:23 PM

Hi forum,

 

is there a way to rebind/refresh the binding between view and view model? I want my application to dynamically load view models into the ContentControl. I've get it done and it  works fine. Now i want to restore a view model into the ContentControl if the user quits the current view (view = usercontrol). The restored view/view model is displayed again, but the binding doesn't work anymore. If i click on a button or something else the corresponding command in view model does not execute. How can i refresh the binding? Many thanks in advance.

 

regards,

xxxcoderxxx

Coordinator
Nov 7, 2012 at 10:10 AM

Check your output window. It normally gives hints what's going wrong. Also, you might want to enable the Catel logger during debugging. In your app startup, use this code:

#if DEBUG
Catel.Logging.LogManager.RegisterDebugListener();
#endif

It is possible to force a binding to update using DependencyObjectExtensions.UpdateAllBindings, but I think this is not the issue here.

If you provide a repro I am willing to take a look at it.