Windows GUI: WPF or WinRT (2015+)

I am trying to get an overview of various technologies to use when creating a GUI in Windows World.

In the context, I am creating a small multiplayer multiplayer game. (For training purpose only ..)

My teacher says that he believes that WPF is the right way, but it seems that he compares it only with Windows Forms.

My perplexity is that here, in 2015, Windows Forms is completely dead?

On this other stacking question, they say that WinRT + XAML is for building a Metro GUI (Window 8 element)! And it looks like WPF is only used for desktop in Window 7/8 and is closely related to Silverlight ..

How does Windows 8 Runtime (WinRT / Windows Store / Windows 10 Universal App) work compared to Silverlight and WPF?

  • On the desktop are old applications (red. WFP).
  • A new class of applications, Metro applications, can be built in several ways, including VB.NET, C # or C ++. These three language options can use XAML to create a user interface. An alternative is to use JavaScript / HTML5 / CSS to develop both the user interface and the application code.

My real question is: Is there no single way to create a GUI in the Window world?

And if not, what technologies should be used in Window 7, Window 8 (Desktop and Metro), Window Phone (and Windows 10!), And even in the x-box.

Can these technologies be compared with other technologies?

Do you think it is right to invest time?

+86
user-interface c # wpf window windows-runtime
Feb 18 '15 at
source share
9 answers

There are many, but here goes:

  • Are Windows Forms (Winforms) Dead? No. It is still actively supported. However, this is a terrible technology to work with (at least when you know the magic of WPF).
  • If you want to create a beautiful, well-designed desktop application (classic, not Metro), WPF is the answer in pure .NET. You can use the WinRT API (for example, their socket classes), but you cannot run them on the OS until Windows 8. The WPF user interface is still there.
  • WinRT applications are designed for the Windows 8 Store (they are also available in the Windows 10 store). You cannot use WPF here or WinRT on the desktop, so where you deploy it determines what you use. You correctly understand the available languages ​​/ technologies.
  • Windows Phone 8 uses a modified WinRT runtime (this has changed in Windows 10). For Win8 / WP8, you can use the "Universal" application to exchange most of the code between the standard WinRT application and the phone window.
  • Windows 10 uses the Universal Windows Platform (UWP) based on the .NET Core. Code developed for Windows 10 can also be used on Xbox One, Windows Phone 10, and HoloLens. WPF is still designed for "standard" desktop applications.
  • XBox is tricky. XNA is leaving, and Microsoft seems to be moving away from the created content community for the platform. However, Unity can be deployed to XBox, and I believe that standard DirectX (C ++) development works for it. Generic applications for the Windows Platform can also be deployed as one Xbox One, and this seems to be Microsoft's future strategy.

How important it is to spend time, it depends on what you are aiming for :). Learning WPF / UWP + XAML will bring you many benefits if you want to stay “current” in the .NET GUI, which is why I would like to. WPF has most of the features, so when you start there, you just need to find workarounds for what is missing in UWP (or any other XAML-based technology).

If you do, be sure to study the MVVM model (model-view-model). It works great with XAML-based technologies and allows you to share logic between your WPF and UWP applications. The same logic can also be used if you end up developing Xamarin apps for iOS / Android, etc.

Please note that for the proper development of the game you will need a real gaming environment (for example, Unity3D or even XNA). You can do this in WPF, and it's a better choice than Winforms, but they are not meant for games.

+122
Feb 18 '15 at 17:19
source share

This is a pretty old thread, but as I came across this via google (out of interest), maybe someone else could get here. This is a question that new programmers ask again and again. Therefore, I would also like to answer some questions now that Windows 10 is officially released.

First, you should no longer start with Windows Forms. This is the most mature technology at the moment, but there will be no further development of Windows Forms, it will only be at the maintenance stage. WPF is actively developing (the last time I read). But now Windows Universal Apps (WinRT one) no longer needs to be used in full screen mode and can be used in windowed mode, like other desktop applications (WPF and WinForms). This greatly improves their usability on non-tablet computers. I believe this will be the future for desktop applications. Although WPF software is a traditional desktop application (no permissions, only UAC). In any case, regardless of whether you learn WPF or WinRT development (using .Net), you end up learning both. Both of them are XAML + C # (or some other .Net languages). I was just learning WPF when WinRT came out with Windows 8. I felt at home, only minor changes that you got used to very soon. However, I'm not sure about the MVVM (data binding) script in WinRT. I am still studying this aspect of WPF.

Window 10 has just started. Windows 8 / 8.1 was not as successful as Windows 7. Therefore, if you want to create an application with a wider audience, you should go with WPF for now. But in the near future WinRT will become a way for you.

For your question, “what technologies should be used for Window 7 , Window 8 (Desktop and Metro), Window Phone (and Windows 10!) And even the x-box.”, The only answer is Windows Universal Apps. It is for this reason that this structure was developed. One technology that will be used to develop applications for all devices. Desktop, Tablet, Phones (including Android using Xamarin bundled with Visual Studio 2015), Xbox, and IoT (Internet of Things).

+25
Aug 11 '15 at 11:05
source share

I will try to answer only one of your questions:

Is Windows Forms completely dead?

No, Windows forms technology is not dead. I will tell you why. WPF and XAML are very complex and sophisticated technology, and you can create a very nice interface. But! This technology requires deep knowledge. For basic layouts, you do not need so much knowledge, but for some advanced layouts you need to have deep knowledge, and when I started with this technology and spent a lot of time searching for some tips on Google. Therefore, when I need some simple forms for user input, I always choose the Windows Forms technology, which is very simple and straightforward. This is also the reason this technology was very successful when it came to the world. When you start with WPF, you also need to know what the MVVM design pattern is, and some of them are not confused by programmers.

+22
Sep 25 '15 at 10:25
source share

This is April 2016, and there is still no clear answer to this question. We are developing a very modern desktop application for real-time performance monitoring, which should display several diagrams and displays mixed with text and other graphics. Our application is C #, WPF with the .NET Framework 4.5.2, but we are still writing some components using WinForms and GDI + to ensure acceptable performance. We simply did not achieve this with WPF. We even developed a couple of displays in an application with DirectX, but this adds a lot of complexity that only some of the teams can support. The simplicity and sheer speed that we can get from placing WinForms screens in WPF and the speed of GDI + gives us what we need in an expensive clean View / ViewModel structure, as well as dealing with various airspace issues. Our application is quite a specialist, and I would really like to get rid of WinForms, but, unfortunately, this is simply not possible in our case. For pure performance, you will need either DirectX or WinForms.

+15
Apr 15 '16 at 7:48
source share

My two cents ... if you want real universal applications, that is, programs that can run on ANY desktop operating system, including Windows, WinForms is still suitable. Just make sure you stay compatible with the CLR, and you can deploy them to Mac and Linux via Mono. Great benefit. XAML may be cool, but it will not be ported to other operating systems.

I personally think that the UWP business model with a sandbox (quicksanded?) Is scared; it takes into account the openness with which Windows stood from the very beginning.

+5
Oct 31 '16 at 7:59
source share

WinRT has been working on the desktop for a long time, I am writing WinRT, which works on my desktop. And under Windows 10, these applications will support unblocked locations (windowed, as you might have known them).

I would not recommend WinForms or WPF for anyone who started today. They should first learn WinRT / XAML. And find out Win32 / .net as needed, depending on their language of choice.

"they say WinRT + XAML for building the Metro GUI (Window 8 element)!" “This is such an excessive abstraction that it is useless.” WinRT is a runtime such as Win32, it’s not only for the graphical interface, so “they say” is a complete BS. XAML is a user interface layer (like XAML in WPF), but to say that the Metro GUI is also wrong, there is no longer such a thing as the Metro GUI. XAML is a layer of the Windows user interface. And the "Windows 8 tiles thing!" expresses the concept of tunnels of certain peoples. It will look like Win32 is the start menu menu. You can see how funny this statement is.

+3
Mar 14 '15 at 1:57
source share

I have been working with Microsoft technology for over 10 years. The most important thing I learned is not just listening to what Microsoft offers you. When Microsoft says this is the future, it has a 50% chance of going wrong. Microsoft will surely do everything possible to promote the products they have invested in, but that does not mean that you should follow. See what happens with WCF and Silverlight.

Although WPF is a very good learning platform, it has a huge learning curve. I do not think that any developer with less than 5 years of programming experience can do WPF correctly.

Following the MVVM pattern, you will find that doing something relatively simple in WinForm can be very difficult in WPF. Similar to the color of a cell based on some specific state after updating, or scroll through the line in the view and highlight it.

Of course, you can say that you do not need to do MVVM. Just put the code in the code and make it work. Yes, it will work, but what's the point of using WPF? Why not just use Win Form?

+2
Dec 23 '16 at 5:32
source share

This is an old thread, but important with the current development of the .NET Framework, C # functions and an increased focus on C # as a game choice.

WPF is almost never chosen as a C # gaming platform. WPF airspace issues scared people pretty quickly. I don’t think that many (if any) main names or main streaming game engines support WPF as a target platform or because of this. WPF makes a great platform for gaming launchers, though!

WinForms, although now in maintenance mode, will still be the right choice for years to come. It is time-tested and stable. From what I saw, even in 2017, WinForms is still the most common platform chosen for developing games based on C #.

Looking at the Steam hardware data , you can see that at the time of writing this answer (July 2017), the 64-bit version of Windows 10 currently dominates the PC gaming platform with a 50% market share, followed by 64-bit 64-bit versions of Windows 7 and 32-bit versions of Windows 8.1 and nearly 7%. All other market shares of OS platforms are so small that it is hardly worth considering anything other than these three.

Given the current state of computer games, WinForms is the most common denominator for all 3 of the best PC platforms. Looking to the future, UWP will be the best target platform for developing C # games, as Windows 7 and 8 will lose a significant share of the Windows 10 market, unless the new platform replaces it. So just by numbers.

If you choose based on the best level of compatibility on the OS platform instead of supporting maximum market share, the choice will be more similar:

  • Windows 10: UWP
  • Windows 8.1: WinRT or Windows Store
  • Windows 7: WinForms

Most of the other answers focus on developing standard Windows applications, but game development is a very different area, and various factors influence your choice, such as the target OS and the fact that your choice of graphical API or game engine is really best suited.

+2
Jul 18 '17 at 9:48 on
source share

I came across this question a year ago. I came to the conclusion that XAML, WPF, and WinRT do not need the right development environment.

I highly recommend using the .NET Framework for the data layer (including web services and the RESTful layer (JSON)) and pure HTML5 / CSS3 and Javascript for your level of web presentation.

In Windows 10, you can integrate any web application as a metro application out of the box.

WinRT, XAML, WPF and similar ms files work only on Windows and have many limitations.

So, after a year, I am still very pleased with my decision not to use WinRT or XAML for my new project.

+1
Dec 10 '15 at 17:03
source share



All Articles