How to get CompositionContainer to create a menu

Dec 29, 2011 at 8:12 PM

Hello,

I wish to create dinamically a menu based on the ViewModels that implements some interface.... I've seen that the CompositionContainer has got in the Parts field the viewmodels... I've tried using Linq to extract the ones that implement IMenu interface but it returns 0 items...

 

since in the loader I do

     container = CompositionHost.Initialize(
            new AggregateCatalog(
                AssemblySource.Instance.Select(x => new AssemblyCatalog(x)).OfType<ComposablePartCatalog>()
                )
            );

is there a way to expose as metadata, or direcly query the viewmodels that implements IMenu?

Thanks