Weak Event Handlers

In a few editions of my book, I showed how to implement weak event handlers which allow an object to be GCd if no other reference is keeping the object alive. If the object is alive, it recieves the event notification and if it isn’t alive, it doesn’t receive the event notification. It has come…

Dynamic objects and Call Sites

In my previous article, I spoke about DynamicMethod. Today I would like to talk briefly about dynamic objects. Despite the similarity in name, these are completely different topics. It is a simple keyword really – “dynamic”. So innocent. So effortless to type. But this new keyword hides some powerful mojo. If you happen to be…

Jounce Part 13: Navigation Parameters

This was a busy morning for Jounce. I checked in some changesets that unfortunately break backwards compatibility but address a few highly requested changes. The first was CLS compliance, and that involved refactoring some weirdly named methods. The second was consistent namespaces (had view vs. views, etc.) so that was cleaned up. The final and…

Using HTML5 Web Storage for Interprocess Communication

One of the exciting new features coming in HTML5 – and one that works in most HTML5 browsers today – is Web storage. The latest draft of the specification defines two types of Web storage: local storage and session storage. Local storage, which is analogous to isolated storage in Silverlight, persists data across browser sessions,…

Jounce Part 12: Providing History-Based Back Navigation

I purposefully kept the navigation engine in Jounce light because there are so many opinions about how navigation should work and what makes sense for a specific application. A foundation is provided to raise navigation events and wire view models to views, but the rest of navigation is a mix of region management and user…

Getting to know DynamicMethod

Many developers are unfamiliar with this very useful piece of machinery. The DynamicMethod class was introduced with framework version 2.0 and Silverlight version 3 as a way to offer a limited amount of IL generation at runtime without requiring the additional overhead that is needed when generating complete types or assemblies. The primary use case…

A Numeric Input Control for Windows Phone 7

I’m exploring the phone more and more and came across the case of allowing the user to enter digits. One thing to keep in mind on the phone is that the form factor requires approaches to input that are different from the traditional desktop. A desktop application might handle numeric entry by simply filtering the…

Building a Windows Phone 7 Application with UltraLight.mvvm

I recently released a new open source project called simply UltraLight.mvvm. The purpose of this project is to make it easier to build MVVM-based applications that support tombstoning (a must) on Windows Phone 7. The DLL is 22KB and the source is less than 300 lines of code. With that, the framework supports: Commands Command…

Jounce Part 11: Debugging MEF

The Jounce framework specifically relies on the Managed Extensibility Framework to help solve MVVM concerns. I recently presented an introduction to MEF and explained what I believe are the four core problems it solves: Discovery — it’s good to decouple, but at some point you need to provide an implementation, and MEF does a great…

Making HTML5 Come Alive with the Canvas API

The last five years of my career have been devoted to Silverlight. I began working with it long before version 1.0 was released, and with Silverlight 5 on the horizon, I’m even more excited about it today than I was then. The fact that you can write phone apps with it is icing on the…

Web Application Installer in WiX

If all you need to do is install your web application into Default Web Site, life is easy. Especially since Windows Installer XML (WiX) has all that support right in the box. Where things get nasty is if you need an installer that lets the user choose the web site, set the web application name,…

Codestock and Knoxville, Tennessee: Are You Coming in 2011?

Codestock is an amazing event that I first attended last year in Knoxville, Tennessee. It’s hosted at a great venue in a wonderful city and loaded with exciting sessions. I had just as much fun speaking at my session as I did attending the other sessions and learning about new technologies. I’ve submitted two talks…