I have an existing WPF project that I am trying to add the DialogManager code from the HelloScreens sample project into. I have added the necessary interfaces/classes, but get the following error in the GetInstance function when MEF is composing things:
GetExportedValue cannot be called before prerequisite import Sample.ViewModels.ShellViewModel..ctor (Parameter="dialogs", ContractName="Sample.Core.Contracts.IDialogManager")' has been set.
The issue lies in my ShellViewModel. I am importing another viewmodel via the following code:
[Import( typeof( IRibbonBar ), AllowDefault = true )]
public IRibbonBar RibbonBar
_RibbonBar = value;
NotifyOfPropertyChange( () => RibbonBar );
If I comment this out, everything works fine. The only thing I found regarding this error was on this page:
However, implementing his suggested fix has no effect. Any thoughts?