Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
Delphi

WinForms vs WPF vs UWP: Expectations vs. Reality

how delphi helps you manage sdks 2216

The first step during Windows app development is determining which Windows app development tools you will use. Let’s do a WinForms vs WPF vs UWP comparison and look at a better alternative from Embarcadero. 

Microsoft currently provides three different frameworks and solutions for Windows development that we will cover in this article. The three solutions are WinForms, WPF, and UWP. There might be a misconception that UWP is a framework like WinForms and WPF but that is not the case. UWP is a much broader solution but has now been deprecated by Microsoft.

What is WinUI 3?

Microsoft WinUI 3 is the latest UI toolkit from Microsoft. It aims to provide an alternative to the MFC, WinForms, and WPF technologies. Written primarily in C++ WinUI 3 is aimed to be a performant library and toolkit which will enable developers using things like WinForms to migrate their apps to use this more recent offering. The WinUI 3 library ships with Microsoft’s Windows App SDK – which was previously called “Project Reunion”. Compared to UWP, for example, Win UI 3 decouples or removes the dependence on the operating system “including the core framework, composition, and input layers of the UX stack” [1].

At the time of writing there are two versions of WinUi available: WinUI 2 and WinUI3. The WinUI 2 version is tightly connected to the Windows 10 and later SDKs. Win UI 3 attempts to break away from that dependency.

WinForms vs WPF vs UWP: Expectations vs. Reality. Screenshot of the WinUI 3 gallery app
Screenshot of the Microsoft WinUI 3 Gallery App

What Is Windows Forms (WinForms)?

WinForms vs WPF vs UWP: Expectations vs. Reality - empty WinForms project
Source: Wikipedia [2]

Windows Forms, also known as WinForms, is a solution with .NET Framework that allows developers to create forms and controls for Windows applications. The original .NET framework has been deprecated. This does not mean .Net (or Dot Net) is going away, there is currently a push to unify the .NET and .NET Core technologies into a new version, .NET 5. There are some significant differences between .NET5 and .NET5 though, for example WebForms (a web based version of WinForms) has been pushed aside in favor of Blazor which is a declarative framework for creating interactive web pages using the C# language.

WinForms provides a wide variety of controls, including buttons, text boxes, and labels. WinForms also supports data binding, which enables developers to bind controls to data sources such as databases and XML files. WinForms applications can be created in Visual Studio by using the WinForms Designer. WinForms applications can also be created in code by using the System.Windows.Forms namespace. WinForms is a tool for developing Windows applications.

Know the benefits when you install Visual Studio and how it can help you get on your way to application development.

What is Windows Presentation Foundation (WPF)?

Windows Presentation Foundation (WPF) is a Microsoft Windows application programming interface (API) that provides a managed-code framework for developing Windows applications. WPF, previously known as “Avalon”, was initially released as part of the deprecated .NET Framework 3.0 in 2006. WPF uses XAML, an XML-based language, to define and link various UI elements. WPF applications can be deployed as standalone desktop programs or hosted as an embedded object in a Windows Presentation Foundation browser application (XBAP). WPF aimed to unify a number of common user interface platform features, including 2D/3D graphics, rendering, animation, and stylistic effects into one integrated platform. It also aims to make it easier to create connected applications such as those that integrate with Windows Workflow Foundation and Windows Communication Foundation. Windows Presentation Foundation is included in the Windows SDK.

WinForms WPF
You can use the native Windows library to access common controls. It uses DirectX with XAML support for programming.
No need to use a markup language for app designing. Instead, use event-driven controls to create the app’s design. You need to use a markup language for complex user interfaces.
Programming can slower than WPF. Supports apps with complex features
It can only develop and design Windows applications. You can develop and design both Windows apps and web-based applications.
It comes with limited controls which are also hard to customize. WPF offers UI customization and controls which allow you to write an app from scratch.
Difficult to separate UI from back-end logic. Possible to separate UI from back-end logic.
It does not have the user interface visualization feature. The user interface visualization feature allows you to manage large sets of data.
You can write apps on a smaller memory footprint but they still usually require a .NET runtime. Requires more memory than WinForms for app development.

What is the Universal Windows Platform (UWP)?

Design guidelines from Microsoft [6]

Universal Windows Platform (UWP) is a Microsoft application development platform. It allowed developers to create applications that can run on any Windows 10 device, including PCs, tablets, phones, and others. UWP apps are built using Universal Windows Platform app development tools such as Visual Studio and Microsoft Expression Blend. Universal Windows Platform app development is also supported by a number of third-party toolsets. Universal Windows Platform apps can be distributed through the Microsoft Store, as well as other app stores and channels. Universal Windows Platform apps could be developed using a variety of programming languages and frameworks, including C++, C#, and Visual Basic.NET. The principles behind UWP seem to have been to have a user interface and experience which would work on a variety of Microsoft platforms, especially the Xbox and the much-loved but ultimately doomed Windows phone.

Despite the “universal” part of the name UWP apps could only run on devices running Windows 10 and Windows 11. They can’t run on earlier versions of Windows such as Windows 8. The release of UWP did attract some criticism [4] due to the intention that UWP apps would be available via the Windows Store which meant that some limits would need to be put in place on the app’s capabilities in order to be in compliance with the Windows Store’s restrictions. The objections were particularly vocal amongst the gaming community where their modus operandi was to push the limits of the computer’s hardware and operating system to the absolute limits which ran counter to more channeled, focused, curated approach of UWP and the Windows Store in general. This resistance seemed to have enough traction among developers that by June 2019 Microsoft announced that Win32 apps would also be able to appear in the Windows Store along with other lessening of the confinements [5].

WinForms Vs. WPF Vs. UWP – which one to use?

From our perspective the answer is none of them – well at least not directly. Choosing between WinForms, WPF, and basing something on UWP can all be very confusing. It doesn’t help that UWP has been deprecated by Microsoft [3] and there is some current state of flux between .NET 4, .NET Core, and .NET5. To be clear, these development choices are not bad, but why chase around a moving target or have to decide which Microsoft technology you adopt. It can be confusing, there is a process of rationalization by Microsoft to try and narrow down choices to be less confusing too, but why not choose an option that is designed to insulate you from needing to understand the available frameworks? Why not go for an option which embraces the best of the available UI, UX, APIs and SDKs and encapsulates them in a way which is both cohesive, comprehensive, and easy to understand?

Software development budgets are tight and dealing with unneeded technical debt can be time consuming. So what is the alternative?

What is the best alternative to WinForms Vs. WPF Vs. UWP?

The best alternative for Windows Forms, WPF, and UWP, in my opinion, is RAD Studio with Delphi. Delphi is an IDE for rapidly developing high-performance Windows and cross-platform applications. It offers a visual design tool and features that developers love, making it one of the most advanced IDEs on the market. Delphi makes it easy to create stunning applications with amazing performance. With its intuitive design tools, you can quickly develop beautiful user interfaces and rich functionality. Additionally, Delphi’s cross-platform capabilities allow you to deploy your applications to a wider audience. So whether you’re looking to develop Windows applications or cross-platform applications, Delphi is the IDE for you. We also have a whitepaper which shows the differences in productivity between Delphi, WPF, and Electron.

What are some of the powerful features of Delphi?

Single Code Base

Create apps for all major platforms with less coding effort. Write once, compile everywhere.

Windows 11

Modernize VCL apps for Windows 11 with up-to-date user interface controls, WinRT APIs, and HighDPI-related features

Remote Desktop

Collaborate more effectively with remote teams using improved remote desktop support for VCL and IDE

High DPI & 4K

High-DPI support in the IDE, with full support for the latest 4k+ monitors, and cleaner and sharper fonts and icons throughout. Improved FMX High-DPI support for Windows and Desktop with a visibly superior desktop UI

iOS and macOS

macOS 64bit ARM compiler and toolchain that can build universal binaries including Intel/ARM versions for AppStore submissions

Android

Support for the latest Android 30 API and latest Billing APIs, and migration to use the AndroidX libraries. Android support for multiple classes.dex files, simplifying integration of external Android dependencies

Accessible Data

Connect to over 20 databases natively with FireDAC’s high speed direct access, including InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, DB2, SQL Anywhere, Advantage DB, Firebird, Access, Informix, MongoDB and more

Faster Coding

Smarter code navigation when refactoring. Auto code completion with Tab key. LSP awareness of Include files. Auto restart of LSP server. Class helper support. Array suggestions when assigning arrays

Productivity

VCL Styles with design-time support: Prototype stylish UIs even faster by seeing immediately at design-time how your styled forms and controls will look when running.

Linux

Develop both server and FireMonkey GUI applications for Linux

User Experience

Completely rebuilt Welcome Page with a native look and feel, and a UI that fits the IDE, and customizable layout and content

Cloud Aware

Use the HTTP and REST client libraries, available on all platforms, to invoke REST services or AWS and Azure components.

Extensions

Develop and expand the IDE with your own components and IDE plugins, or find ready to use add-ons from our rich third-party ecosystem

RAD Server

Reduces the complexities of rapidly building and deploying a multi-tier turn-key enterprise REST API application server with Swagger support.

Are you ready to start using the best Windows app development tool?

If you’re looking to get started with Windows app development tools, or want to supercharge your team’s productivity, Delphi is the perfect solution. With powerful new features and quality improvements across all platforms, it’s never been easier to create high-quality applications that work seamlessly on any device. Ready to get started? Download a free trial of Delphi today and see for yourself how easy it is to build amazing apps with Delphi.

 

 

 


References

[1] https://learn.microsoft.com/en-us/windows/apps/winui

[2] https://en.wikipedia.org/wiki/File:Screenshot_of_WinForms_Designer_as_seen_in_Visual_Studio_2019.png

[3] https://github.com/microsoft/WindowsAppSDK/discussions/1615

[4] https://arstechnica.com/gaming/2016/03/tim-sweeney-to-microsoft-universal-windows-platform-can-should-must-and-will-die/

[5] https://news.xbox.com/en-us/2019/05/30/microsoft-approach-to-pc-gaming/

[6] https://learn.microsoft.com/en-us/windows/apps/design/basics/


What's Coming in Delphi, C++Builder, and RAD Studio 11.2 Alexandria

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES