Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# windows desktop application

I'm familiar with creating websites in ASP.NET MVC using C#. But I never learned how to create desktop applications with C#. So I wanted to look a bit more into this. I got the back-end pretty much covered since I'm experienced with ASP.NET. But I have no idea when it comes to front-end development. I'm guessing Microsoft offers several approaches to create desktop applications (forms, MVC, ...) Just like java offers different packages. But when I open visual studio, all I see is the possibility to create a Windows Form application.

  1. What possibilities do there exist for creating Windows Desktop applications in C# (Windows forms, mvc?)
  2. Which is considered "thebest"/"most widespread"?
  3. Any recommended tutorials, guides or free e-books?
  4. Any other advice is always welcome.
like image 609
Reinard Avatar asked Dec 17 '22 02:12

Reinard


2 Answers

If you're using Visual Studio, which most people do, it's a bit of a hard choice.

WinForms are great for quick projects which don't require too much customisability of the design in things like borders, backgrounds, due to it using Microsoft's pretty old forms (They've been visually revamped a lot and obviously adjusted) they have a lot of limitations (Such as no padding on things like text fields), but they still look nice and are nice if you just want a regular application with a clean UI.

If you want a dynamic one which is easier to adjust and much more customisable, and also separates design from code using XAML, you definitely want WPF. Sadly you'll need to put in a decent amount of time to learn XAML fluently.

So to sum up, if you want a quick project that looks nice, and you don't want to learn XAML, WinForms If you want to spend a little longer to make it more visually attractive and customisable (Mostly on the coding end, not the end user's), it's got to be WPF.

Another advantage of WPF is that, like I said, it separates design and code, so you could collaborate with a designer at some point on the future. There's also hard-coded WPF as far as I know, but most people use XAML.

Also, I've never looked this up, but I'd give a good guess it's much easier to get a job with experience in WPF as opposed to WinForms in a professional environment due to the design/code seperation

like image 150
Ashley Davies Avatar answered Dec 27 '22 00:12

Ashley Davies


I recommend WPF over WinForms, and there, MVVM pattern suits best.

WPF is more modern, powerful and flexible than WinForms, which is not technically obsolete, but not as promising (similarly to WebForms perhaps). XAML skills will be useful for Silverlight as well as Metro apps development.

As for WPF / MVVM resources - tons of it on the internet. For one, have a look at Prism framework

Comparing the MVC and MVVM patterns along with their respective ViewModels - also a good read.

like image 29
Konrad Morawski Avatar answered Dec 26 '22 23:12

Konrad Morawski