Microsoft has published a roadmap for Windows Presentation Foundation (WPF), identifying three big modernization issues, but the extent of the company’s commitment to it is undermined by a comment that “We do not believe we will be able to deliver all 3 items.”
“WPF community, please help us vote for Modernization investments,” said WPF team Engineering Manager Pankaj Chaurasia, directing developers to this document. The WPF team has shortlisted three key features. One is Windows 11 theming, with support for features such as “snap layout, rounded corners for controls, and newer color schemes.” Another is nullability annotations, which control whether or not a reference type should ever be assigned a null value. This improves code quality by enabling many null reference errors to be caught by the compiler.
The third is native support for a folder browser dialog. It sounds odd; but WPF lacks a built-dialog with which users can select a directory. The issue was raised on GitHub in 2019, but the official advice remains to use an API from Windows Forms, an unsatisfactory solution. “I am utterly shocked as well (like many here) to realise such a fundamental method is not available for WPF,” said a developer 18 months ago, but it remains outstanding.
Voting is taking place here and at the time of writing Windows 11 theming is winning, with FolderBrowserDialog in second place and nullability annotations third. But why is the company struggling to find resources to fix all three? It does seem that only minimal resources are being directed at the project, confirming indications last December that it is a low priority. That said, the team stated that “we want to create a larger vision for WPF. We are not ready to do it just yet (the team is fairly new),” and suggested that a new “vision document” may be available in around 6 months.
WPF is one of two older desktop application frameworks based on .NET, the other being Windows Forms. WPF was introduced as one of the “three pillars of Longhorn” back in 2006, with WPF known by the codename Avalon. It was intended to bring DirectX accelerated graphics and sane scaling to custom Windows applications. WPF failed to persuade all developers to move away from the easier Windows Forms framework, but did find significant favour and remains in use by many business applications; it is also used by Microsoft in Visual Studio. Strategically though it was pushed aside for Windows 8; and the official direction now is WinUI 3, which unfortunately lacks any sort of compatibility with WPF.
The low level of investment in WPF, and the fact that even the .NET Core variant of the framework is Windows only, has caused many developers to look elsewhere. The leading candidate, for those wishing to stick with the spirit of WPF, is the open source AvaloniaUI, which is one of the most active projects overseen by the .NET Foundation. A related option, for businesses needing maximum compatibility with WPF, is Avalonia XPF, unveiled last week.