Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

Commented Unassigned: Must Remove "View" from Window View [10539]

$
0
0
I noticed to get my app to work using the Prism 4.2 for WPF beta, you have to remove the "View" from name of Window View in order to wire up with the ViewModel. As an example, my View must be named MainWindow.xaml and the ViewModel is MainWindowViewModel. I thought the convention for the View would be MainWindowView.xaml.

I noticed this was the case for the BasicMVVMQuickstart_Desktop example, as well. Is this a current bug and be fixed for final release or I'm I doing something wrong?

Thx
Comments: ** Comment from web user: blainew **

The behavior you are seeing is by design.

I copied the following content from the documentation that is close to being released so you know the convention based rules.

To locate the corresponding view model, the __ViewModelLocationProvider__ first attempts to resolve the view model from any mappings that may have been registered by the Register method of the __ViewModelLocationProvider__ class. If the view model cannot be resolved using this approach, for instance if the mapping wasn't created, the __ViewModelLocationProvider__ 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 .ViewModels child namespace, that views are in a .Views child namespace, and that view model names correspond with view names and end with "ViewModel.".


Viewing all articles
Browse latest Browse all 1878


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>