Deferring starts with Castle’s StartableFacility

If you’re using Castle Windsor as your IoC container, the StartableFacility is great simple way to start up services like timers, socket listeners, etc that run for the duration of your application and require two-step initialization — i.e., constructing them then starting them. All you have to do is implement an IStartable interface, with a …

Background event handling in Prism

Prism’s event aggregator is great for decoupling UI state changes when UI events occur, but sometimes you need to perform some larger, long-running task on a background thread — uploading a file, for example. Here’s a quick example of an encapsulated event handler listening off the Prism event bus, and using Windsor’s IStartable facility to …