Developers who work within Microsoft’s universe will treat recent announcements about the Windows Presentation Foundation (WPF) with some interest. The corporation are promising important improvements in performance, interoperability and new and improved tools which will likely impact how developers use the platform.
How the roadmap will pan out in the coming years and what impact this will have on the WinForms class library could have significant consequences for developers’ projects. Microsoft’s plans reveal some exciting things about their plans for the future of WPF and it appears to offer many of the things WinForms does but better.
While no definite statements have been made about killing off WinForms, official wiki guides about moving away from WinForms to WPF hint at what Microsoft just might be thinking. This post will provide a catch up on what exactly WPF is, what it has to offer and what Microsoft are telling us about its future. How this will impact on developers who are used to WinForms is the big question here though, and we’re interested to see what WPF will mean for it.
What is WPF again?
WPF was originally launched as part of .NET Framework 3.0 and sits in the stack beneath .NET Applications and .NET development tools. It is one of the most important technologies for developing Windows desktop applications and offers a number of interlinked functions which make it appealing for developers:
- Rich XAML language
- Integrated binding engine
- Custom styling possibilities
- Hardware acceleration technique
All said, it’s a powerful package and, unlike WinForms, it’s built on DirectX. This translates into rich, fast graphics and explains why it’s become very popular with developers.
Development (not) on hold
For a couple of years there were no new updates on WPF and there was a fair bit of speculation as to whether the platform would be canned. Microsoft released no new blogs, add-ons or developments and so naturally the community begun to wonder whether it would disappear. All these questions were answered however when Microsoft let the world at large know what it had been up to.
Using feedback, interviews and surveys conducted with a large number of WPF developers, Microsoft have come up with areas for future investment in upcoming releases of WPF. This research with professionals should really have paid into what developers actually want and need and provide a solid base to these new releases.
So, what’s been improved?
Microsoft have been working hard to fix a lot of minor WPF issues to coincide with the release of .NET version 4.6. These will include:
- Multi-image cursor file support in System.Windows.Input.Cursor
- Support for transparent child windows.
- Improved double tap gesture recognition by using common threshold distance from registry.
- Improved text selection through double tapping the WPF TextBox control.
- Improved reliability of stylus input for the WPF ComboBox control.
In addition to these improvements, Microsoft have also released a new UI Performance Analysis Tool for WPF Applications. This involves a new Timeline tool which is a replacement for the existing XAML UI Responsiveness tool that supports WPF applications in Visual Studio 2015 CTP 5. Current support is limited to WPF (.NET 4.0 and above) and Windows Store 8.1 applications running on Windows 8.1 or later. They are exploring adding support for Windows 7 in a future release of Visual Studio (more information over here).
And what’s to be expected?
Microsoft have clearly put in a lot of work bringing the WPF up to scratch. Looking forward, the roadmap promises a number of exciting improvements:
- Performance: WPF is actively being used to build large-scale, high performance applications like Visual Studio and Blend and further improving the performance of the platform based on customer feedback is a priority. Some key scenarios that Microsoft are currently keen to optimize are application startup, scrolling and virtualization performance of ItemsControls.
- DirectX interoperability: The primary scenario of interest here is to make it seamless for WPF applications to interoperate with newer versions of DirectX.
- Supporting modern hardware: Technologies like touch and high density displays are ubiquitous on modern devices. To support upgrading to newer hardware, it’s important that existing WPF applications can adapt to new hardware capabilities coming to desktop machines.
- Tooling: Microsoft plan to keep on co-evolving the tools for WPF when appropriate, alongside new platforms like .NET/WINRT.
WPF looks likely to emerge as the choice over WinForms
WinForms superseded earlier, more complex C++ class libraries and, in its turn, look likely to be overtaken too. As technology improves and the requirements of different platforms evolve, new solutions emerge as more able to respond to requirements.
WPF is definitely a sure choice over WinForms as it is in many ways vastly superior to the latter. That’s not to say the WinForms is obsolete or useless and for some tasks it remains an important and valuable platform. Take for instance the tile control which was built from WinForms - it was well received and Microsoft is working on improving its touch capabilities.
Nonetheless, in the coming years it looks more and more likely that WPF will overtake WinForms and there’s a good chance that Microsoft may eventually stop providing support. For developers, this means keeping an eye on what’s happening. WinForms is still very much part of the mix, but knowing how to use WPF looks like an increasingly worthwhile string to your bow.