Skip to content

UWP vs. WPF

jbe2277 edited this page Dec 1, 2018 · 4 revisions

This article compares the Universal Windows Platform (UWP) with the Windows Presentation Foundation (WPF).

WPF is an UI technology stack based on the .NET Framework. UWP is a complete new application platform which was introduced as an alternative to the classic Win32 application platform. This evaluation compares both technologies on the application platform level.

UWP provides different UI technology stacks for writing UWP Apps. These are:

  • XAML UI and a C# or VB managed backend
  • XAML UI and a C++ native backend
  • DirectX UI and a C++ native backend
  • JavaScript and HTML

This comparison takes for UWP only the XAML UI and a C# or VB managed backend variant into account.

The term Universal in Universal Windows Platform might be misleading. Apps written for UWP are running only on Microsoft Windows. They cannot be used on other operating systems like Android or iOS. In Microsoft’s context universal means that these Apps are not limited to classic desktop PCs or notebooks. Other device types like Phones or the Xbox are supported as well.

The following comparison table shows how these technologies differentiate from each other:

Topic WPF UWP (XAML UI)
Introduced in 2006 (.NET Framework 3.0) 2015 (Windows 10)
System Requirements >= Windows XP >= Windows 10
Supported device types PC, Notebook, Tablet PC, Notebook, Tablet, Phone, Xbox, IoT, Surface Hub
User interaction Optimized for keyboard and mouse Optimized for touch
Application model
  • Classic Windows (Win32) application platform
  • Runtime: .NET Framework
  • Supported languages: C#, VB or F#
  • New app platform designed to run on various device types
  • Runtime: Windows Runtime (WinRT)
  • Supported languages: C# or VB
UI technology stack WPF is built from scratch with more than 80% managed code. XAML UI is a complete new native UI stack.
Rendering Vector graphic UI based on DirectX Vector graphic UI based on DirectX
Customization
  • Very flexible and powerful to adapt and restyle UI controls.
  • Adaption of control behavior can be done with .NET API.
  • Like WPF but no that powerful.
  • Adaption of control behavior can be done with WinRT API.
Styling / Theming Styling support is very powerful. But it is also complex. Similar as WPF but it has much more limitations.
UI Definition Declarative: XAML (XML dialect) Declarative: XAML (XML dialect)
Deployment
  • XCopy deployment
  • ClickOnce deployment
  • Classic installers (MSI, …)

Limited to Microsoft Store

  • Must pass Microsoft’s certification process
  • Limitations of #
  • Microsoft takes 30% of income

Sideloading for internal distribution

Distribution No limitations. Does not depend on an App Store. Only Microsoft Store or Sideloading can be used.
Resource access Applications can access all resources the user has permission for (e.g. file system).

Resource access is defined by App Capabilities. This way a user sees what the App is allowed to do (e.g. use location service).

An App cannot overcome some restrictions. Examples:

  • FileSystem access is restricted to libraries (e.g. Document library)
  • Starting of processes / services is forbidden.
  • Interprocess communication is forbidden.
Performance Managed code is in general slower than native code and requires more memory. UWP Apps written in C# or VB are compiled to .NET Native. This way the app has almost the high-performance of a native app.
Long term support Yes. WPF is part of the .NET Framework. Yes. UWP is part of Windows.
Mature Yes. This technology is in maintenance mode. Innovative improvements are not expected anymore. Not yet. This technology is developed actively.
Tool support Visual Studio XAML designer; Expression Blend Visual Studio XAML designer; Expression Blend
Known drawbacks
  • The learning curve is quite steep.
  • WPF Apps are slower than UWP Apps because of the managed code.
  • Distribution and resource access are very limiting.

Here are some characteristics shared by both technologies:

  • Support for Separation of Concerns:
    • Separate language to describe the UI layout (XAML)
    • Powerful databinding allows a cleaner separation of UI and domain logic
    • Command pattern
    • See also Model-View-ViewModel Pattern

Further readings

  1. Using Windows Runtime in a .NET desktop application
Clone this wiki locally