I try to get Unity to resolve a type (object) using a factory method with parameter, but i can't get this working. The source of the Problem is described in this answer answer.
It says i need to register every view with:
m_Container.RegisterType<Object, View>("View");
Otherwise the RequestNavigate("View") Method will fail, but i don't like this approach. I wan't to navigate with RequestNavigate("Namespace.View") but this does not work.
So i tried to tell the Unity Container how to resolve the views:
this.Container.RegisterType<object>(new InjectionFactory(this.ViewObjectFactory));
private object ViewObjectFactory(IUnityContainer iUnityContainer, Type type, string name)
{
//Never called
}
But if the Container gets called with the following parameters:
this.Container.Resolve(typeof(object), "Namespace.View");
A object gets created and the factory method is ignored, how can i get unity to call a factory method for a type (even if the resolve method is called with a name).