Automated Silverlight Unit Testing Using StatLight

One concern with the Silverlight Unit Testing Framework is that it runs on a UI thread and requires a browser to function. This makes it difficult to integrate into automated or continuous integration testing. Difficult, but not impossible. A solution is provided by the project called StatLight which not only supports Silverlight testing automation, but…

Silverlight Unit Testing Framework: Asynchronous Testing of Behaviors

Last month, I bogged about Unit Testing ViewModels AND Views using the Silverlight Unit Testing Framework. I wanted to take that post a step further and talk about some more advanced testing scenarios that are possible. The site itself provides a lot of information about how to get started and what is available with the…

Silverlight 4’s New Managed Extensibility Framework

One of the less-talked-about features of Silverlight 4 is the new Managed Extensibility Framework, or MEF. MEF has been evolving on CodePlex for a while now. It’s slated to be integrated into .NET 4.0 and Silverlight 4, and as such is something with which developers should be familiar. As its name implies, MEF is a framework…

PRISM, MEF, and MVVM Part 3 of 3: Dynamic MEF Modules in PRISM

Series recap: PRISM, MEF, and MVVM Part 1 of 3: Unity Glue PRISM, MEF, and MVVM Part 2 of 3: Making PRISM MEF Friendly PRISM, MEF, and MVVM Part 3 of 3: Dynamic MEF Modules in PRISM In the final part of this series, I will show a dynamically loaded module (using PRISM) that takes…

PRISM, MEF, and MVVM Part 2 of 3: Making PRISM MEF Friendly

In the first part of this series, we explored using the Unity container to bind the view model to the view. The next logical step is to explore how to use MEF. PRISM provides several useful mechanisms that relate directly to views and modules, such as the region manager and the module manager. This allows…

Silverlight 4’s New HTML Hosting Support

Another of the new capabilities that Silverlight 4 brings to the platform is the ability to host HTML content inside a Silverlight control. This support isn’t limited to static HTML content; the content can be interactive and can include script. It can even be Flash content or content that includes other Silverlight controls. To host…

Receiving notifications when garbage collections occur

While creating the 3rd Edition of my CLR via C# book (http://www.amazon.com/CLR-via-C-Third-Pro-Developer/dp/0735627045/ref=dp_ob_title_bk), I came up with a cool little class that will raise an event after a collection of Generation 0 or Generation 2 occurs. Here is the code for the class: public static class GCNotification {   private static Action<Int32> s_gcDone = null; // The…

PRISM, MEF and MVVM Part 1 of 3: Unity Glue

PRISM, also known as Composite WPF, has established itself as a very popular framework for building modular, scalable Silverlight applications. A newer contender, the Managed Extensibility Framework (MEF), has also grown in popularity. In fact, these two frameworks have left people scratching their heads wondering which one to use, when, how, and why. Download the…

Silverlight’s Big Image Problem (and What You Can Do About It)

Quick: Can you spot the problem with these three lines of code? BitmapImage bi = new BitmapImage(); bi.SetSource(stream); TheImage.Source = bi; These statements create an image from a stream of PNG or JPG image bits and display the image by assigning it to a XAML Image object named TheImage. It’s boilerplate code used to display images read…

Fractal Koch Snowflakes in Silverlight

So late last night I decided that since I spend most of the day writing software for other companies, it was time to build something for my daughter. I knew right away it would be snowflakes. I’m not much of a “graphic design” guy, but I do know math, so when I can lean on…

Silverlight 4’s New Local File System Support

In my last blog post, I wrote about Silverlight 4 applications that run outside the browser with elevated permissions and their ability to leverage COM automation servers on the host PC. Another privilege that applications with elevated permissions—also known as “trusted apps”—enjoy is the ability to access parts of the local file system without prompting the…

Dispatching in Silverlight

Anyone who has been building Silverlight and/or WPF applications for some time understands that there is a single UI thread that has special access requirements if you are going to be updating elements. In other words, if I spin off a new thread, I cannot arbitrarily impact the UI unless I get back to the…