I'm experimenting and trying to understand the Catel framework.
I understand that Catel has a Naming convention to register Views and viewmodels.
According to documentation the [AS]
convention, should be replaced by the assembly name.
This is not the case for me and I have to manually write the assembly name as follow:
string aSSname = Assembly.GetExecutingAssembly().GetName().Name;
var viewLocator = serviceLocator.ResolveType<IViewLocator>();
viewLocator.NamingConventions.Add(aSSname + ".Views.[VM]Window");
The following code dose NOT work for me:
viewLocator.NamingConventions.Add("[AS]"+ ".Views.[VM]Window");
More Info (if its help):
All the Code above is placed in App.xaml.cs
I load viewModel as separate assembly:
AppDomain.CurrentDomain.PreloadAssemblies(typeof (App).Assembly.GetDirectory());
to sum up, How can I make this example to work with [AS]
convention.
My Guess:
My guess is that viewLocator is looking in the wrong assembly. probably looking in the same assembly were the viewModels are.
if this is right, how can I change the viewLocator
so it search in the correct Assembly?