0

Suppose there is a solution with following projects and their respective references:

  • ModelBase
  • MyModel
    • ModelBase
  • ViewModelBase
  • MyViewModel
    • ViewModelBase
    • MyModel
  • GenericModelEditor
    • ModelBase
    • ViewModelBase
    • WPF

MyModel contains both models and example data.

How can I get concrete implementations and sample data in GenericModelEditor at design time without introducing hard project references, reusing models/viewmodels/data that already exist ?

I would like to somehow access all types (assemblies) accessible in whole solution, perhaps using some component design-time services or EnvDTE interfaces and their Blend equivalents to instantiate classes from MyViewModel.

Blend support is less important than VS.

Marcin Wisnicki
  • 4,511
  • 4
  • 35
  • 57

1 Answers1

0

Hope that this is not to obvious, but have you looked into PRISM4 with MEF or Unity

http://compositewpf.codeplex.com/

Introduction to MEF

http://blogs.msdn.com/b/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx

Where can I learn about MEF?

Community
  • 1
  • 1
klashagelqvist
  • 1,251
  • 2
  • 26
  • 52
  • Unfortunately I'm not allowed to use them ;-( Do they support injecting services from unreferenced projects at design-time ? – Marcin Wisnicki Feb 02 '12 at 16:06
  • Well they support your , as far as i can see, MVVM structure and Dependency injection. Im not to sure what you mean by unreference projects thoough. If you mean unreferenced in the sense that they are not in your solution and they have exported there functionality through MEF or Unity then the answer is YES – klashagelqvist Feb 03 '12 at 09:57
  • Added some useful links about MEF – klashagelqvist Feb 03 '12 at 10:09
  • I know basics of MEF but I'm more interested in how it is doing it, assuming it can do it (I must replicate this functionality without using MEF/Unity). I've glanced at the their source code but so far have not found what I look for. – Marcin Wisnicki Feb 03 '12 at 10:16