In my WPF main window written in XAML, I have a side content presenter and a main content presenter. Each area can dynamically load one of several different user controls from code based on what the user is doing in the application.
My question is this. Let’s say that the side content user control will always contain a text box named “SideBox”. And let’s say that the main content user control will always contain a text box named “MainBox”. How do I bind the value of “MainBox” to the value of “SideBox” regardless of which combination of main and side user controls that I load?
Provide both UserControls with a dependency property that the other can bind to or
Some xaml:
This can be done in code as well.
or bind both UserControls to the same ViewModel.