XAML vs WPF vs Store App vs Phone App vs UWA

12,521

Solution 1

When .NET was released in ~2000, you could use WinForms to make desktop applications for Windows. It provides access to 'native' controls (i.e. A Button made in WinForms actually is a Windows Button control from user32.dll) by wrapping the Windows API in managed code. These can run in any version of Windows which has the appropriate .NET framework version installed, including upto Windows 10.

In 2006, WPF was released which is an alternative to WinForms. WPF uses XAML, which is a language based on XML, to declare the user interface elements. In a simple WPF app, the .xaml file describes the GUI and the code-behind file describes the logic. DirectX is used to draw whatever is described in the .xaml into the window.

Like Winforms, programs made using WPF can run in any version of Windows which has the appropriate .NET framework version installed, including upto Windows 10. Note that using XAML is completely optional. Whatever user interface elements you describe using XAML can also be made using your .NET language C# or VisualBasic.NET. But using XAML is usually simpler. See To XAML or not to XAML (MSDN Blogs).

From XAML (Wikipedia) :

As XAML is simply based on XML, developers and designers are able to share and edit content freely amongst themselves without requiring compilation.

From ~2012 along with Windows 8, a new kind of app called metro/modern/windows-8/windows-store-apps can be made. These apps are similar to WPF in that they use XAML for describing the GUI. These apps can run only in Windows 8, 8.1 and Windows 10. Windows 8.1 added some improvements and features but remained mostly the same. The same technology was used to make apps for Windows Phone.

With the release of Windows 10, Microsoft made UWP (Universal Windows Platform) through which you can use the same code base to target differnt kinds of devices (desktop/mobile/xbox/IoT/holographic). These apps made for the UWP are similar to the earlier Windows 8/8.1 apps. Like before, XAML is used to describe the GUI.

Only for the Windows Store apps, there is no backward compatibility. The timeline goes Windows 8 -> Windows 8.1 -> Windows 10/UWP. An app made in UWP can only run in Windows 10 and an app made in Windows 8.1 can not run in Windows 8.

Solution 2

I would highly recommend referring to this discussion thread in stopbyte, it has far more details and explanation of the concepts behind WPF, UWP And WinRT.

As for WinForms, from my experience it's history now. Have been almost replaced by WPF (though it still has mainstream support as mention by @Jazimov). I'v noticed that Microsoft has stopped improving Windows Forms and probably has stopped maintaining it as well.

Share:
12,521

Related videos on Youtube

Yeasin Abedin
Author by

Yeasin Abedin

8 years of experience in the Software Industry. Experienced to work in business domains like Shipping Industry, ERP, IoT, etc. I have been a part of both small and large Agile oriented teams, for Local and European clients. I have worked on projects of small and large scale, from scratch to an existing architecture. My professional projects include .NET stack, ASP.NET core, Azure, Docker, SOA, Microservices, Angular. Apart from coding, I have worked on supporting live systems and managing small groups of teams. I like to refer to myself as a problem solver, irrespective of the technology stack.

Updated on June 04, 2022

Comments

  • Yeasin Abedin
    Yeasin Abedin almost 2 years

    I know that XAML is used for designing UI in combination with Blend. I am confused with so many terms, like, how XAML comes into play for WPF, Store App, Phone App or UWA. Morever, what is the difference between WPF, Store App, Phone App and UWA. Does all that means that old Desktop Project will no longer be used and replace by either WPF or Store App or UWA?

    • JWP
      JWP
      The history goes like this. WPF was first using XAML. Then along came WINRT which sent MSFT into space and spinning off what they called just XAML for Store Apps. Just google WPF DEAD? Phone APPS can use XAML too but it is its own platform kind of like Silverlight was. To close these gaps UWA came around and who cares any more because MSFT hosed everything with Windows 8, and is trying to bring it all back together and they are failing to do that. BTW you don't need Blend at all.
  • Yeasin Abedin
    Yeasin Abedin about 8 years
    Thank you for the answer. So it means, if I want to run my application in various devices (PC/Tablet/Phone) for Windows 8.1, I have to go with Universal project template of Windows 8.1. And for Windows 10, I have to go with UWP project template, right?
  • Arctic Vowel
    Arctic Vowel about 8 years
    Yeah that's right. Note Windows 8.1 is not as 'universal' as UWP, since it can only do sharing of resources between a Windows 8.1 desktop and Windows 8.1 Phone. In UWP the same code base is used for all form factors.
  • Michel Feinstein
    Michel Feinstein over 7 years
    correct me if I am wrong, but I think XAML is not the same in winRT as it is in WPF.
  • Arctic Vowel
    Arctic Vowel over 7 years
    @mFeinstein You're right, we can't always directly copy over the XAML from one platform to another. A XAMLButton translates to the class in System.Windows.Controls for WPF and Windows.UI.Xaml.Controls for WinRT. But it should be familiar once we know how it works in one platform.
  • Dinei
    Dinei over 7 years
    So, if I want to make a Windows software that should run on Windows 7 and above, the best option is to use WPF, am I right?
  • Bob Bryan
    Bob Bryan over 7 years
    @Dinei Rockenbach - Yes, WPF would be the only option if Windows 7 needs to be supported since windows 8 is the earliest OS required for UWP apps.
  • Lex Li
    Lex Li almost 7 years
    XAML is also optional for UWP, docs.microsoft.com/en-us/windows/uwp/get-started/whats-a-uwp and even C# is only one of the languages supported by UWP.
  • Jazimov
    Jazimov about 6 years
    Winforms definitely is not "history". It has mainstream support from many third-party vendors (DevExpress, Syncfusion, Telerik, Infragistics, ComponentOne, Dart, etc.), and still-thriving forums. And, no offense, but answers with non-authoritative "I believe"-type factoids are of little relevance to people looking for answers.