Nested imported VMs

Jan 13, 2012 at 4:23 PM
Edited Jan 13, 2012 at 4:28 PM

I have a few nested ViewModels. I export them by [ExportViewModel("Name", true)] attribute and want to import them by [ImportingConstructor].

What is the right way to do it?

As I understand [ExportViewModel("ABC")] is not equal [Export(typeof(ABC))] so

[ExportViewModel("ABC")]
class ABC

[ImportingConstructro] public XYZ(ABC abc)

Will not work.

And the solution is:

[Export]
[ExportViewModel("ABC")]
class ABC

 

Hopefully, [ExportService] works great in this way.

But is there any way to import exported by [ExportViewModel] attribute class into [ImportingContructor]?