I was able to resolve the issue by overiding SelectAssemblies like below.
protected override IEnumerable<Assembly> SelectAssemblies()
So how should i go about doing this?
protected override IEnumerable<Assembly> SelectAssemblies()
{
List<Assembly> assemblies = new List<Assembly>();
assemblies.AddRange(base.SelectAssemblies());
// Load new ViewModels here
string[] fileEntries = Directory.GetFiles(Directory.GetCurrentDirectory());
foreach (string fileName in fileEntries)
{
if (fileName.Contains("MyCaliburnControlLibrary.dll"))
{
assemblies.Add(Assembly.LoadFile(fileName));
}
}
return assemblies;
}
But in my ViewModel constructor I inject the DI container ..which is a NONO!So how should i go about doing this?
protected override void ConfigureContainer(ContainerBuilder builder)
{
// good place to register application types or custom modules
builder.Register<RibbonControlViewModel>(c => new RibbonControlViewModel(this.Container));
}
[ImportingConstructor] public RibbonControlViewModel(IContainer container)
{
this._container = container;
this._windowManager = container.Resolve<IWindowManager>();
this._eventAggregator = container.Resolve<IEventAggregator>();
this._eventAggregator.Subscribe(this);
}