Choosing the right .net technology for desktop applications

Recently I've been presented with a difficult question: which is the right choice of .net technology for desktop development. There are three choices currently available: Windows forms (WinForms), Windows Presentation Foundation (WPF) or Universal Windows (UWP).

Microsoft has made clear it's path for .net, with the release of .net core, associated web frameworks and UPF for Windows devices.

However, adoption of UWP has been met with much resistance. This is partly due to the insistence that all deployed applications only be available via the Windows Store. The Windows Store requirement stems from a desire to expand the app library on the currently sparse marketplace. So with a poor uptake on UWP, there is a fair chance that this will be superseded by a future technology sooner rather than later.

Another option is WinForms, released in 2003 and the building blocks of many applications in use today. There has been much speculation about the retirement of the technology, but it continues to be supported and, to some extent, developed today. Built on GDI, still present in Windows today, it looks to be a consideration for years to come.

WPF was first released in 2006. The uptake was initially slow, due in part to the cost of retraining development teams and also the missing features that a feature rich WinForms provided at the time. Several years on and WFP is now as feature rich as WinForms. It has the ability (with effort) to create visually stunning user interfaces. Many major software titles are developed in WPF, including Visual Studio (from 2010 onwards). Importantly, for visual effects WPF utilises the GPU over the CPU, something that WinForms has to be specifically programmed to do. So an equivalent WPF application could reduce the load on the CPU.

The conclusion we came to was to adopt WPF. It seems that Microsoft, for the time being, is pushing XAML for user interface development (with it’s inclusion in UWP and WPF), so it’s a worthwhile investment to learn it. It also seems that porting applications from WPF to UWP will easier than from WinForms. So if UWP does gain traction then having our solutions in WPF will place us in a stronger position. Finally, using XAML allows us to create visually stunning user interfaces, which is a requirement of the systems we develop.