Tuesday, March 9, 2010

MVVM with MEF in Silverlight Video Tutorial Part 2: Plugins and Metadata

In the first part of this series, I demonstrated a very simple project that used MVVM (Model-View-ViewModel) along with the Managed Extensibility Framework to produce a simple screen that toggled between a square and a circle.

In this next video, I am re-designing the original project. This video starts with the original solution, but then I rework the code, using metadata, to turn the shapes into plugins. I duplicate the original effort with the new design (using a combobox instead of a checkbox because now we can support 1 ... n plugins) and then show how easy it is to add a new plugin with the architecture.

Download the source code for this project.

Here is the final application:

Download the source code for this project.

Jeremy Likness

16 comments:

  1. Thanks for these great tutorials Jeremy. I've just started looking at MEF and MVVM and you've done an excellent job of showing how to bring them together. Really looking forward to part 3.

    ReplyDelete
  2. You're welcome! I'm looking forward to filming it. :)

    ReplyDelete
  3. Jeremy - great stuff. Very helpful in trying to get comfortable using MEF with MVVM. Any idea when you'll have Part 3 of the series available for viewing? Thanks again

    Dave

    ReplyDelete
  4. Hi, Dave. Thanks for the feedback! I don't have an exact date. As part of the MEF Contrib team, I'm responsible for helping with quickstart projects and videos, so while it may not continue this specifics series, I will be recording new examples in the weeks and months to come. Stay tuned!

    ReplyDelete
  5. Great post Jeremy. I am learning how to use MEF and MVVM together and this is a great demo showing how that can be done...

    ReplyDelete
  6. When are we getting a part 3 ??? This is a great series!

    ReplyDelete
  7. Soon! Thanks for the positive feedback. I'm prepping for a few talks coming up (one in Atlanta, one in Knoxville for Codestock) and also working on MefContrib documentation, so eventually I will create the time to get it done ... might overlap with some of what I'm doing for the MefContrib project, as it will include video quickstarts like this.

    ReplyDelete
  8. Do you plan on continuing this video series?

    ReplyDelete
  9. Absolutely, but via my work with the MefContrib team:

    http://mefcontrib.codeplex.com/

    ReplyDelete
  10. Couldn't really follow mvvm and mef until i saw your videos. Excellent tutorial.

    thanks,
    Alex

    ReplyDelete
  11. oh and couldn't wait for the part 3... :-)
    --
    Alex

    ReplyDelete
  12. Jeremy where is part 3? show more how mef can be integrated with silverlight

    ReplyDelete
  13. Jeremy, you have done an amazing job! Hands down this is the best explanation of MEF I've found anywhere.

    ReplyDelete
  14. Video does not work....on any part of this post :(

    ReplyDelete
  15. Hi Jeremy, have you decided not to do Part 3 in this series, this has helped me understand MEF better than the MEF documentation.

    ReplyDelete
  16. Hi jeremy i tried opening the project with SL4 and VS2010, it doesn't open in that , also with the same flow it throws error when in App.xaml CompositionInitializer.SatisfyImports(this) with below error
    Cannot set import 'SingleXAPSilverlight.App.MainView (ContractName="SingleXAPSilverlight.MainPage")' on part 'SingleXAPSilverlight.App'.
    Element: SingleXAPSilverlight.App.MainView (ContractName="SingleXAPSilverlight.MainPage") --> SingleXAPSilverlight.App

    ReplyDelete