Jun 4, 2014 at 3:50 PM
Edited Jun 4, 2014 at 3:52 PM
Thanks for sharing this.
class has an attached property,
that when set to true (as in your scenario) will try to locate the view model of the view, and then set the view’s data context to an instance of the view model. To locate the corresponding view model, the
first attempts to resolve the view model from any mappings that may have been registered by the
method of the ViewModelLocationProvider
class. If the view model cannot be resolved using this approach, for instance if the mapping wasn't created, the
falls back to a convention-based approach to resolve the correct view model type. This convention assumes that view models are in the same assembly as the view types, that view models are in a
child namespace, that views are in a .Views
child namespace, and that view model names correspond with view names and end with "ViewModel."
If you don't have any mapping registered, it might be possible that this is failing because your ViewModel is not following the default naming convention (It should be named FluentRibbonViewViewModel instead of FluentRibbonViewModel)
If your View Models are in different assembly, then you will have to override the logic of the ViewModelLocator.SetDefaultViewTypeToViewModelTypeResolve
I hope you find this helpful.