There is no suitable method to override

Topics: Questions
Jun 11, 2014 at 1:59 PM
GetViewModelType() and GetViewModelInstance() ??
Coordinator
Jun 11, 2014 at 2:00 PM
Removed for simpliciation.
Coordinator
Jun 11, 2014 at 2:01 PM
Jun 12, 2014 at 7:25 AM
Edited Jun 12, 2014 at 7:28 AM
Thanks for the link.

Sorry, but I have still some problems with catel. 4.0

I try to register my Viewmodels in ViewModelLocator instead of GetViewModelType()

For my standard viewmodels i try to add a NamingConvention

Namespace of View: MyAssembly.Views.Pages

Namespace of ViewModel: MyAssembly.ViewModels.Pages

So I add the following NamingConvention

viewModelLocator.NamingConventions.Add("[UP].[UP].ViewModels.Pages.[VW]ViewModel");

But ViewModels could not be found. Is the NamingConvention wrong?


PS:
Name of the View: GeneralPageView
Name of the ViewModel: GeneralPageViewModel
Coordinator
Jun 12, 2014 at 6:57 PM
According to the docs, your naming convention should be:

viewModelLocator.NamingConventions.Add("[UP].[UP].ViewModels.Pages.[VW]ViewModel");
viewModelLocator.NamingConventions.Add("[UP].[UP].ViewModels.Pages.[VW]PageViewModel");

NOTE: Page will be removed as shown in the docs. If you use it in your naming convention, add it manually
Jun 25, 2014 at 7:18 AM
Hello again :-)

This don't works any more in the latest version:

viewModelLocator.NamingConventions.Add("[UP].[UP].ViewModels.Pages.[VW]PageViewModel");

Added Page manually: And thats my resolvedTypeName:

"ConfiguratorControl.ViewModels.Pages.GeneralPagePageViewModel"
Coordinator
Jun 25, 2014 at 8:43 AM
There was a bug in the Naming Convention system:

https://catelproject.atlassian.net/browse/CTL-470

Make sure your naming conventions fit to the fixed bug.
Jun 25, 2014 at 1:37 PM
? Now I don't have to add any more the "Page" prefix? Correct?
Coordinator
Jun 25, 2014 at 1:40 PM
Name of the View: GeneralPageView
Name of the ViewModel: GeneralPageViewModel

In the old version, this would use the view name "General" instead of "GeneralPage" (it now only strips 1 of the allowed postfixes).

You should now use this naming convention:

viewModelLocator.NamingConventions.Add("[UP].[UP].ViewModels.Pages.[VW]ViewModel");

And it should work.
Jun 25, 2014 at 1:47 PM
Ok. Like I did it before. :-)