We have been struggling with trying to figure out how to bind data that is in the ViewModel to controls that are in a UserControl on the Window. There is probably some really simple way to do this but I haven't figured it out. I have many examples of how I
need to use this but here is one in particular. I have a ribbon control that I have put in a UserControl. I want to bind the Title of the ribbon control to the dependency property VRATitle that I have in the ViewModel. Here is what I have in the UserControl:
Window}}, Path=VRATitle}" FlowDirection="LeftToRight" >
This gets me to the parent of the UserControl. The main window xaml has the following
<DockPanel Name="RootDockPanel" >
<DockPanel DockPanel.Dock="Top" >
Since the DataContext for the main window is the ViewModel this does seem to work - but I'll bet it's anything but the right way to do it.
In other cases I have many controls in the UserControl that I place on a page. How would I get the "City" data from the window's ViewModel for binding. Please excuse me if I am way off on my attempted solution here as I am really new to WPF/XAML and
the whole M-V-VM design. Can anyone shed any light on how to connect this up?