Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I'm used to being able to whip up a simple to moderately complicated windows application using Windows Forms, and being able to get it to lay out everything without too much fuss. I can spend most of my time on the logic. This is good.

Now, with XAML, UWP, etc, using the designers is like visiting the dentist - but is it as necessary?

I'm not sure where to go from here, because unless I'm just doing it wrong these designers do not speed me up at all. They are useless. They are not RADworthy.

I'd rather just code it in C#.

What do you all do? I can't be the only one.

What I have tried:

Patience. Recreational substances. Giving up all hope.

The designers are just awful. Awful awful awful. They're harder to use than typing the XML by hand and that too is just awful.
Posted
Comments
PIEBALDconsult 7-Feb-24 21:52pm    
Did you have a question?
honey the codewitch 8-Feb-24 2:55am    
Yeah. To people that use UWP, what does your effing process look like?
PIEBALDconsult 8-Feb-24 10:33am    
Not me. I use WinForms when a command-line utility won't suit.
honey the codewitch 8-Feb-24 11:22am    
That's where i'm at right now, but I can't shake the feeling of being on borrowed time.
PIEBALDconsult 8-Feb-24 11:37am    
I'm sure my copy of VS 2010 (Express) will continue to work just fine for a while yet.

Roger Deutsch wrote a series of articles on the subject: Programming Windows 10: UWP Focus (1 of N)[^]. I worked through it all and built the examples successfully. But as all my programming is just for fun I don't think I will use it much in future.
 
Share this answer
 
Comments
honey the codewitch 8-Feb-24 3:49am    
Thank you. I'll bookmark that, but I've also just had AvaloniaUI and Blazor recommended as potential alternatives. Looks like I have a lot of legwork to do, but this is a much better position to be in than I was in when I asked initially. =)
My answer, cross posted from the lounge[^].

If I were still using XAML, I would use Blend with it. It takes a little bit of getting used to, but it's far superior to working with the layout designers in VS. When I do have to write a pure desktop app, I use AvaloniaUI. It's waaay better than Maui. Most of the time, now, I'm using Blazor. The ability to run both in the browser, and as a PWA for those who want to run it on the desktop.
 
Share this answer
 
Try Flutter, You Won't Be Disappointed
I faced the same dilemma as you - choosing the right framework for my next project.
I evaluated numerous options, finally deciding on Flutter: it was a game-changer!
The development speed and stunning visuals it offers for both desktop and mobile applications are truly remarkable.
Even for a seasoned programmer like myself (who loves C/C++!), the learning curve for Flutter was surprisingly quick.
 
Share this answer
 
Adding to the already plenty solutions, I've asked myself this question recently.
For a customer, I need to replace old VB6 applications throughout a factory.
Web isn't an option as I need to communicate with hardware on the machines (although that hardly seems an issue now that we're working on it...).

Anyway, an obvious contender would be WinForms, but as you said, that's dying.
Microsoft ported WinForms to .NET, so it isn't actually dead yet, but I wanted the new software to be modern.

So then WPF (Windows Presentation Foundation) could be the logical successor, since that's also ported to .NET.
However, WPF is XAML, and as you said, that's like pulling teeth.
So we'd be pulling teeth in an old framework that was only recently ported to keep some grumpy old developers happy (I guess).

I've seen UWP (Universal Windows Platform) mentioned here, but Microsoft already officially dropped support for it so this isn't even an option anymore!

However, UWP used WinUI 2 under the covers and WinUI 3 is the official successor that's also still supported.
It's XAML, but at least it's modern!

Looking outside the Microsoft stack, we have more web-based solutions, like Flutter and Uno Platform.
Two stood out for me, which are really alternatives to Flutter and Uno respectively, Electron and Avalonia UI.
Visual Studio Code was built using Electron, so you get an idea of what it can do and how it can look.
It uses web-based technologies, like HTML, CSS and JavaScript and somehow compiles(?) them as cross-platform desktop applications.
Avalonia UI uses XAML (in fact, it's considered the spiritual successor to WPF), but also produces cross platform desktop applications.
If your choice comes down to Avalonia UI or Uno, Avalonia is the clear winner with a larger community on GitHub.
As a plus, the Avalonia team has (ex-)developers from the WPF team!
My problem with these technologies, while they seem to work and look great, is that they aren't native applications, meaning they do their own drawing instead of leaving that to the operating system.
The result is that they can look and feel like they're not desktop/Windows/Apple applications at all.

Ultimately, I went for .NET MAUI.
.NET MAUI is the successor to Xamarin, which is of course a mobile framework.
However, .NET MAUI can create cross platform apps that work on mobile and desktop!
In theory, at least, because in practice you're going to face plenty of challenges.
.NET MAUI, like Xamarin, uses XAML too.
So why did I pick .NET MAUI?
We're only targeting Windows for now and for Windows it compiles to WinUI 3, which are native windows apps.
WinUI 3 has more options as it doesn't have to work for mobile as well, but .NET MAUI is the latest greatest and I already foresee some mobile work in the future as well.
That said, .NET MAUI is a bit of a gamble as well, since Microsoft doesn't seem to update it all that well and for some serious bugs in .NET 7 simply said "you'll have to wait until .NET 8 because we're not patching .NET MAUI for .NET 7."
As a result, lots of Xamarin developers haven't embraced .NET MAUI and are looking for alternatives.
So far it's looking pretty good for us though, I just hope both Microsoft and the community will embrace it a bit more.

Last, but not least, you can use .NET MAUI with Blazor, which allows you to run a web app (HTML, CSS and JavaScript mixed with .NET) on your desktop in a .NET MAUI shell app.
It was a serious consideration, but quite frankly I didn't want to be bothered with web technologies either, and it won't compile as a native Windows app either.

Figured it all out earlier this year, so consider this the summary of my research.

[Add]
To answer the question of how to deal with XAML, it's not that different from HTML, is it?
Just suck it up I guess.
[/Add]
 
Share this answer
 
v2
Comments
honey the codewitch 8-Feb-24 9:21am    
Thank you. That gives me plenty of food for thought.
CPallini 11-Feb-24 6:31am    
Wow.
It's been agessss since I posted here but I came here on a whim this morning and saw this question & it caught my attention

As others above have said, Avalonia, .NET MAUI, and WinUI 3 are all decent options. I also find (found?) writing XAML to be like a trip to the dentist. The amount of fracture in the ecosystem since WinForms's heyday is a testament to how difficult it is (in my opinion) to recreate its superior developer UX. I wish that WinForms had been incrementally improved, not replaced with XAML-based solutions.

I'll throw another option into the ring: GitHub - picoe/Eto: Cross platform GUI framework for desktop and mobile applications in .NET[^]

I built some hobby projects with it a few years ago and found it to be a surprisingly pleasant experience.
 
Share this answer
 
If you want to rant, shoot the breeze, etc, then use The Lounge[^] forum. This is for those who are stuck or stumped and need help with code.
 
Share this answer
 
Comments
honey the codewitch 8-Feb-24 2:54am    
Haha, I put it here because I thought it was too much of a programming question to be in the lounge. In fact, a may just cross post there now so I can get yelled at in both places. =)

Truth is, I *am* stuck. I can't use these tools as provided by Microsoft. There has to be a way people work with UWP and the like every day, but as it's packaged and sold? This technology is cumbersome, confusing, and near impossible to use fluidly. I do need help.
OriginalGriff 8-Feb-24 4:00am    
I absolutely agree with you: I first discovered this when I considered moving from WinForms to WPF - but the designer tools in VS were so piss-poor that I just gave up and stuck to WinForms.
Hand coding XAML after the drag'n'drop excellence I was used to? Why? It just made WPF feel "unfinished" and turned me right off the whole idea. It's the 21st Century: we shouldn't have to put up with crap like that.
honey the codewitch 8-Feb-24 4:06am    
what did you end up doing about it?
OriginalGriff 8-Feb-24 4:10am    
Stuck with WinForms. Still works for me.
Graeme_Grant 8-Feb-24 4:30am    
Just saw this ... did not see who posted... 😬

I'm old-school, so don't use the designer window view for WPF, besides, DI + MVVM = broken designer! I still code XAML by hand. I only use it for debugging while the app is running. Even then, in a very limited capacity. The same goes for coding web pages, hate designers for them too! Have no interest in UWP apps, so can't comment.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900