MEF: DLL Versions and Multiple Exports for a Class

During my talk about the Managed Extensibility Framework (MEF) at Devscovery this past week, I had two very good questions asked by the audience and promised I’d get an answer. The first one was about exporting in MEF. I was under the impression that a MEF part could have one export, but I was mistaken.…

MVVM with Transaction and View Locator Example

I had a lot of requests after both of my posts about transaction with the Model-View-ViewModel (MVVM) pattern and Yet Another View Locator Pattern to provide a sample project. You asked, I listened, and here it is. I’ll walk through how I built the example. Most of the code is taken verbatim from my two…

Yet Another MVVM Locator Pattern

Been working with a lot of customers using the MVVM pattern with MEF and the issue always comes up regarding how to marry views to view models. There have a been a few musings on this, from my own ViewModel locator pattern to the even more advanced (and elegant) locator proposed by John Papa et…

Transactions with MVVM

One objection to MVVM I often hear is that it doesn’t manage transactions well. I’m not talking about database transactions or “true atomic” transactions, but those short-lived transactions that happen in the UI. With data-binding, updates happen immediately. If I pass a validation, the field is updated. Many applications, however, don’t work this way. While…

Converting Silverlight 3 to Silverlight 4

In this video, I wanted to share just how quick and easy it is to convert a Silverlight 3 project to Silverlight 4. The steps are basically as follows: Make sure you have the Silverlight 4 tools If you use Blend or any of the interactivity extensions (for triggers and behaviors) be sure to get…

Ten Reasons to use the Managed Extensibility Framework

One question I’m commonly asked is, “Why do I need the Managed Extensibility Framework? How do I know when to use it?” In addition to that really being two questions, I’m not sure I can tell you the top ten reasons to use MEF or whether or not it is the right tool for you.…

Using WriteableBitmap to Simplify Animations with Clones

I’m going to deviate from my typical “line of business” blog posts to discuss a topic that comes up quite a bit with Silverlight: animations. I’ve had a few projects where it’s been necessary to use animations to transition between “screens” in the application. While I use the visual state manager as often as I…

Sequential Asynchronous Workflows Part 2: Simplified

I received quite a bit of feedback related to my sequential asynchronous workflows post. Most people asked if I could simplify the example even more and/or show the inner workings of the coroutine engine itself. Because the source for the library I demonstrated in the last post is not available, I’ve put together a very…

Sequential Asynchronous Workflows in Silverlight using Coroutines

It all began with a post I read in the Silverlight.Net forums. A user, new to Silverlight, was frustrated with the asynchronous programming model required by Silverlight and wondered how to make all of the calls synchronous. I admit I heavily resisted the notion because I think the asynchronous programming model is one that developers…

ViewModel binding with the Managed Extensibility Framework

This is just a short post to share an “ah-hah” moment I experienced building out a large Managed Extensibility Framework (MEF) Silverlight application. Traditionally, I’ve wired in the view models using the code behind. I’m not one of those who believes code behind is evil no matter what, so I haven’t taken issue with something…

Custom Export Providers with Custom Metadata for Region Management

Over the past few weeks I’ve been exploring the concept of region management using the Managed Extensibility Framework, and for a good reason. I’m working on a project that has several different regions and controls that must be managed effectively and across the boundaries of dynamic XAP files in Silverlight 3. Sound like a mouthful?…

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…