So - as I mentioned it looks that the DataContext must be set in the UserControl that has the RibbonControl in it in the constructor BEFORE the InitializeComponent() is called. Curious. I would think that you could set the DataContext at any time as it does
cause a DataContextChanged event to occur. Shouldn't that wire things up?
In the app.xaml.cs file I would think that I could create the Window, create the ViewModel, and then set the DataContext of the Window (and by inheritance the UserControl's DataContext) and that should make everything work.
void App_Startup(object sender,
//Show the main window
PenskeRouteAssist vRAWindow =
vRAWindow.dockManager.ParentWindow = vRAWindow;
// Create the ViewModel to which the main window binds
var penskeRouteAssitViewModel =
vRAWindow.DataContext = penskeRouteAssitViewModel;
catch (Exception ex)
Any ideas? I'm not sure if even if this works that the CanExecute() methods in the ViewModel that should enable and disable the Ribbon Buttons will work if the value changes from True to False.