Replies: 2 comments 3 replies
-
Just to be clear, Prism doesn't care about the path on disk as much as the namespace. By convention the ViewModelLocator only works when the ViewModel is in the You have a couple of options.
containerRegistry.RegisterForNavigation<ViewA, ViewAViewModel>();
ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(type => {
// Your logic here..
}); Prism/src/Prism.Core/Mvvm/ViewModelLocationProvider.cs Lines 46 to 54 in 7f0b168 |
Beta Was this translation helpful? Give feedback.
-
Ok, so I have dug much much deeper and discovered that it appears for AutoWireViewModel to work the control must be a FrameworkElement descendent and the NavBarGroup component in the DevExpress library is descended from FrameworkContentElement. So I think this is why the AutoWire isnt working. Does anyone have any work around ideas? |
Beta Was this translation helpful? Give feedback.
-
I have tried everything I can think of and find online to make this connection but nothing will connect up the two and create the VM.
I have a View in a menu folder and the corresponding VM is in the ViewModels folder ....
I tried the method BL used in his Outlook series, putting the ViewModelLocationProvider.Register in the ApplicationsModule.cs file at the root of the module ..... didn't work.
I tried all of the different syntaxes that the Register method provides .... didn't work.
In the attached file I am trying the override of the ConfigureVieModelLocator() and adding the Register there ... doesn't work.
Any help would be very much appreciated.
ApplicationsGroup.txt
App.xaml.txt
Beta Was this translation helpful? Give feedback.
All reactions