Open jcansdale opened 6 years ago
To remove the dependency on IGitHubServiceProvider
, we would need to replace exports like this:
[Export(typeof(IMyViewModel))]
with something like:
[ExportViewModel(typeof(IMyViewModel))]
there would be a kind of symmetry with:
[ExportViewFor(typeof(IMyViewModel))]
The ExportViewModelAttribute
would export IViewModel
and allow a ExportFactory
to be located using the defined type (IMyViewModel
in the example above). We could then import the VM factories into ViewViewModelFactory
like:
[ImportMany]
IEnumerable<ExportFactory<IViewModel, IViewModelMetadata>> Views { get; set; }
The CreateViewModel
method would be similar to CreateView
and not depend on IGitHubServiceProvider
.
@grokys what are your thoughts on this?
The
ViewViewModelFactory
class currently has dependencies onICompositionService
andIGitHubServiceProvider
, which I'm not sure are necessary. It also usesAllowRecomposition = true
, which I don't think is supported in Visual Studio's flavor of MEF.I'd like to see if this can be simplified, so we don't confuse people looking at this class in future.