Archive For The “WPF” Category

MVVM async progress meter example using the Task Parallel Library

I’ve just posted up on GitHub a quick example WPF application that shows an MVVM-style progress meter dialog, using the .NET 4.5 Task Parallel Library (TPL). Specifically demonstrating: A progress meter using .NET 4 Tasks (not BackgroundWorkers). Async support. Cancelling of Tasks via CancellationTokens. Exception handling back to the original thread. Reporting background progress updates […]

Read more »

The Fat ViewModel

If someone asked you, what are the building blocks of MVVM, what would you say? Models, Views, and ViewModels, of course. It’s in the name. But really, there are two others: Models Views ViewModels Commands Events If Commands and Events aren’t strongly represented in your application, I’d say there is a strong chance it isn’t […]

Read more »

Reactive Extensions and Prism: LINQ to your Event Aggregator

A lot of people have been talking about the Reactive Extensions for .NET, a flash new library from Devlabs which lets you do LINQ to .NET events just like you can with collections. My team at work has started using it pretty heavily, and today I wrote an adapter that allows you to use Rx […]

Read more »

Null Object pattern for a WPF ComboBox’s deselected value

Last week, I encountered a problem doing some fiddly UI behaviour in a Prism/MVVM app. I wanted something like this: FX curve: USD GBP EUR GBP I wanted a ComboBox where you can choose one of the available options, or none of them. Null, deselected, whatever. Unfortunately for me, WPF doesn’t support binding null values […]

Read more »

WPF: How to combine multiple assemblies into a single exe

At work, I am currently working on a small WPF app that we want to keep as a simple standalone exe. However, it has dependencies on several third-party assemblies: SharpZipLib, Unity, ServiceLocator, etc. Microsoft has handy tool called ILMerge that merges multiple .NET assemblies into a single dll or exe. Unfortunately, it doesn’t support WPF […]

Read more »