WinForm vs WPF vs UWP vs Console – The C# Desktop UI Showdown (and the future with .NET 5)

30
2



Which C# desktop UI should I use? Is the latest one the best? Is WinForms dead? Aren’t Console applications super-old technology? These are all questions I get on a weekly basis so I thought I would take some time and walk through the four major options for desktop applications. We will discuss the benefits and drawbacks of each UI, and then we will discuss the future.

One of these platforms is finally dying, and it probably isn’t the one you think.

At the end, we will also discuss the future of the .NET Framework, .NET Core, and .NET 5 so that you can properly understand the direction you need to head going forward.

Patreon:

Newsletter signup (with exclusive discounts, giveaways, and more):

Nguồn:https://wijstaanvooronzegrondrechten.org/

Xem Thêm Bài Viết Khác:https://wijstaanvooronzegrondrechten.org/cong-nghe

30 COMMENTS

  1. Hi Tim…Your comment/info about UWP's benefit of being the only UI platform that has access to the Microsoft Store is not accurate. Microsoft provided a feature called the "Desktop Bridge" that allows Winforms and WPF apps to access and be sold in the MS Store. Thanks for the helpful video.
    Edit: After listening to the remainder of your video I see you mention the Desktop Bridge later after you finish going over the entire grid. If you ever re-record this one I would suggest mentioning the Desktop Bridge when you go over the grid, or instead not listing "Store Distribution" as a UWP-only benefit. Again thanks for the helpful video!

  2. Excellent compare and contrast,, Tim!
    I've been a professional developer since 1978. I'd say 90% of my development is in WinForms for precisely the reasons you stated. I'm usually writing a custom app for a customer that wants it yesterday and could care less about the newest and shiniest. Now if I were developing a product for sale with a wider market, WPF all the way.
    Excellent series of videos! I'm recommending them to my team members.

  3. Hi TimCorey, you make great videos, thanks for that. I have a question about UWP. I am currently working on a project in UWP (already approx. 2 years). The app is getting bigger and bigger, new features are added, etc…. The biggest disappointment for me is the performance. Compared to WinForms, it is a lot slower, XAML pages (even with just a few controls) can take long to load. There are a lot of articles already on the internet about how to improve page loading in UWP, which I don't consider normal those articles even exist. I am used to work on Win32 projects where simple forms just load instantly. So, this is already a real turn off. But it also has it good sides, the interface looks good and modern, controls are developed to be used on tablets. So that is nice, but I am wondering let's say I want to drop UWP, what are the alternatives? My company wants the app to be accessible from the windows store, so when a customers buys an additional tablet, he can install the app himself, without having to contact us for a new install. So I am wondering what are my options? With WinForms, there will be some extra programming needed to make everything look good and usable on tablets (main target for our app). With UWP all controls are touch ready and the size is default already ok for tablets. UWP also has addaptive layout, it automatically adjusts itself to different screen sizes, which WinForms doesn't have. If your edit box doesn't fit on WinForms, it goes out of scope and that's it. So I don't know what to do for the future, stick with UWP and if not, what are the alternatives… Thanks !

  4. personal experience with wpf. i had my campus voting system as thesis and i decided to capitalize that container-based wpf so i could put the candidates pictures in one container, make it function like a grid view or combo box just like what i see in dropdowns in web apps. so when i finished the system, i decided to test it by rapidly voting 50x with different dummy users. as i get to the 10th voting process, pictures of the candidates started to disappear. although it was still clickable for voting, it is not a practical method to just let it go. as i continued to the 20th, almost all of the pictures are gone. when i looked the the error tab, it says memory leak exception or something. according to articles it happens when unmanaged resources overflow. since wpf doesnt have the this.Dispose() method of winforms, I have to wait for the garbage collector to clean the unmanaged resources.

    i recreate the system using wpf INSIDE winforms using wpf interop control, and used this.Dispose() to the voting form, turned out great. no more memory leaks.

  5. I have been killing myself trying to find a way to use Web technologies to develop the front-end for a .Net plugin that's hosted from another application. I've been using WinForms and WPF and it's really easy to wire the functionality to the UI, but I cannot, for the life of me, find resources on how to do the same with HTML/CSS. I've checked Electron, it seems fine for a stand-alone app, but not for something hosted in another software.

  6. I'm working in WPF and it is definitely difficult to learn.

    There's layers upon layers of understanding you have to obtain, and how they all work together, and there's just too many ways to do the same thing. Positional parameters shouldn't even be a thing, at least let me set something like "Mode=Strict" like you do in VB so that things have be done in a verbose way so I don't look at my code down the line and wonder what the hell I was doing.

    I feel like they tried to make a programming language out of XML. Things like binding inside XML are great, but do we really need to be able to reference "null".

  7. Great video. Hopefully you can get a better understanding of the thinking and direction behind WinUI 3.0 (https://github.com/microsoft/microsoft-ui-xaml/issues/717) than I can. I know that UWP, WPF and WinForms stay. The important point mentioned on that github roadmap is: "We plan to create new Visual Studio 2019 project templates for common languages (e.g. C# using .NET Core, standard C++17 using C++/WinRT) and app model + packaging (UWP + AppX, Win32 + MSIX)".
    The best I can tell, if you use this new template, you will be making a desktop application that uses the modern Win 10 UI controls (textbox, checkbox, etc.), and will "somewhat" be like the UWP world, but without the limitations you mentioned for UWP.

    I'm an experienced WinForms developer. I'm guessing that instead of opening/closing forms, that it will be more like UWP or WPF. I'm OK with letting go of WinForms and going modern, for the sole benefit of the modern controls, mainly the basics…checkbox, textbox, etc. I just hope this template/model has at least a little bit of WinForms-like feel, and not just WPF and UWP merged. There's supposed to be a previous release of WinUI 3 this Winter, but I don't know if the project template will also be there.

  8. Thanks that was very helpful to me, I used to develop in VB6 many years ago but have been out of the loop for a while. Now I am trying to get back into development but was confused by the options available. Just the right pace for me too.

  9. I have a project to build an application to store records and view them etc. in a store. I'm completely new to c# although I can read and understand a little bit .
    I have experience in flutter framework and JavaScript language and also a good understanding of html/css etc.
    I have learnt C programming too.
    I know python ( for OOP kind ).

    What I want to say is , I need to build the application and be able to scale it for multiple stores too. And I have clearly no idea how to do it and what to follow. Did some googling and found C# and .net are the go to.
    Help? (Winform /wpf / uwp) I'm unable to understand anything.

    Thanks 🙂

  10. Wait.. that's a bad new for me, I mean.. I am just starting out with desktop application development with c# for the reason it being a more modern language for desktop development. But most of the tutorials here are in .net framework, so.. should from this point only learn everything with .net core, or go with .net framework and then move to .net core ecosystem Microsoft is preparing?

  11. So long as Microsoft has ambitions of not being Intel x86 bound I think UWP will still be kicking around. It was the reason they made that framework not to just only unify across a cross-platform Windows environment but to do so regardless of the hardware that Windows screen was running on. I think MS actually built a framework with unintended consequences that just might be a net benefit. Like pairing UWP with UNO Platform gets you a Win10, Android, iOS, and Web Assembly App for the price of one code base … and the UI can be made to all look the same in different screens or be quickly adjusted for each. Obviously I'm just speculating myself … so who really knows the chaos that is the MS machine. One thing for certain is that console and WinForm RAD are here to stay as they are basic timeless concepts.

  12. I tried windows forms but i dont really like the drag and drop items Im looking something like flutter but c# is drag and drop only

  13. First, UWP is powered by GPU and it is vector based, so it is so much better and flexible in scaling. Second, UWP has a better XAML implementation than WPF and it does everything WPF does but better. So, I dont think UWP will be dropped. However, you are right that the problem with UWP was that it was too tightly integrated with Win 10 and its iterations when not all previous windows devices are ready for upgrade. MS has addressed this problem by decoupling UWP from windows and while MS is waiting for the world to upgrade to Win10, MS put a temporary strategy. MS has not changed its strategy in distributing apps which is by using Win store. So, currently MS is re-energizing WinForm and WPF apps such that they can be easily distributed via Win Store. So, to sum up, console is not going anywhere, WinForm and WPF will not be getting new features, however, they will be updated to support unification of .net and whatever .net strategy in future. As for UWP, it is already using .net from the very start; It is already modern architecture. I think once the windows 10 has a bigger adoption and windows core released, there will only be console and UWP standing.

  14. At two different companies now, I have quickly shown Business Analysts how to use Visual Studio and WinForms to create mockups.. and fine-tune them based on user feedback. This greatly aided in their requirements gathering process. It also greatly allowed us developers to focus on ongoing dev work.

  15. For my company, WinForms RAD equates to faster delivery time and reduced development costs vs WPF. We still have no compelling reason to chose WPF over WinForms.

  16. Is WPF difficult to learn compared to WinForms? I want to use gadgets like temperature, Energy, humidity etc that will get values from my hardware.

  17. UWP is not going to fade away. On contrary, future client side consumer OS will only support UWP, because of its sandboxed security benefits. Look at Windows 10 IoT Core (Business) as a first step in that direction. Also UWP has optimized binding compared to WFP. Microsoft invests alot in UWP / Core . net . However it's still very limited in capabilities and WFP today is still muuuuuuuuuuccchhhhhhh more powerfull, damn.

LEAVE A REPLY

Please enter your comment!
Please enter your name here