Frage

I have a window with an injected view via Caliburn.Micro;

<ContentControl cal:View.Model="{Binding ViewModelObject}"/>

Now, without Fody.Costura I can see that my ViewModel is being requested via the IoC container. Shortly afterwards (when then the control can be seen), CM asks the IoC for the View class.

Now, when I use Fody.Costura the ViewModel type is first requested and resolved through the IoC, which means the assembly has been unpacked and loaded. However, CM never asks the IoC to resolve the View type, and I simply have the "cannot find view for ... " message on my Screen.

So, the issue is that while the View and ViewModel types can be resolved through he IoC, Caliburn Micro chooses not to even try to get the View when I've used Costura.

I presume Caliburn.Micro has a preliminary check to look for a type, and that fails when you use Fody.Costura to merge the referenced assemblies.

Any idea how to resolve that?

Update:

I attached an ILog debugger to Caliburn and with Costura I get the following warning:

WARN: View not found. Searched: Module.Recorder.Views.RecorderView, Module.Recorder.ViewModels.RecorderView.

However, as mentioned I know the assembly is loaded as I load it to search for NInject modules, and I can see Module.Recorder.Views.RecorderView is injection-bound.

War es hilfreich?

Lösung

The problem was my referenced Assemblies. I have to load them manually in SelectAssemblies()

Unfortunately, I was using the accepted solution here, which loads them from the exe directory.

My solution to the above problem was to explicitly load the referenced-assemblies from the currently loaded assemblies, as answered here.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top