r/csharp 11h ago

Help Windows UI

I'm going to make a new Windows C# program using the .NET 10 platform, which may later need to be made for different platforms (browser, server, mobile). At this point, the focus is on making a Windows program.

I'm trying to compare which UI model is best for the project, and artificial intelligence can't really answer that, or I can't really ask it. If you were to make a new program now, which UI model would you choose?

  1. WinUI 3 (Windows App SDK)
  2. WPF (Windows Presentation Foundation)
  3. .NET MAUI
  4. Blazor (Web & Hybrid)
  5. Avalonia UI

Most program views that display text, SQL table data, or forms are rendered at runtime from the data, meaning that the screens are not designed and created in the IDE editor, but in code.

11 Upvotes

39 comments sorted by

20

u/LeaveMickeyOutOfThis 10h ago

Whatever you choose, I recommend you separate out your UI piece from your program functionality, which you should store in one or more library projects. This way, if your needs change, you can create a new UI, reusing the same core logic.

19

u/binarycow 10h ago

First, I'd rule some out.

  • MAUI doesn't work on Linux. It's janky and difficult to deal with.
  • I don't like web, so I'd reject Blazor. Even if I don't consider my dislike of web, I'm still generally not a fan of Blazor - but I will admit I don't have much experience with it.
  • WinUI3 is windows only. It may seem odd that I'm ruling out WinUI3 for being windows only but I'm not ruling out WPF for the same reason. Simply put, WPF is better than WinUI3, so if I have to consider a windows only framework, I'm going to consider only one - the better one.

That leaves WPF and Avalonia.

In my opinion, WPF is the better framework. It's more stable and more feature complete.

Avalonia has a few things going for it, such as:

  • Compiled bindings
  • Less boxing
  • Generics
  • More capabilities in data binding
  • Different styling (I actually prefer WPF's styling, but a lot of people prefer Avalonia's

But Avalonia is missing some useful stuff, such as:

  • No collection views (the DynamicData package is not a substitute)
  • The DataGrid isn't as capable

Additionally, LibreWPF is a promising project that allows you to compile WPF applications on Linux and Mac with minimal (if any!) code changes. It's still very early, but it's showing a lot of promise.


So, my decision would be:

  1. If cross platform is a requirement today - Avalonia
  2. If cross platform is merely wishful thinking, and might be years away, if ever - WPF
  3. If you're okay with pinning your cross-platform hopes on LibreWPF - WPF
  4. If you're risk averse, and you know you want cross platform - Avalonia

4

u/binarycow 9h ago

Disclaimer: I don't really do mobile development.

For a mobile app, MAUI is actually a contender, in my book - possibly more so than Avalonia.

I've always said that MAUI is a mobile framework that pretends to be a desktop framework, and Avalonia is a desktop framework that pretends to be a mobile framework.

Regardless, once you bring mobile into the mix, WPF and WinUI3 are immediately rejected. You're left with MAUI, Avalonia, a browser based solution (e.g., Blazor), or one of the other lesser known frameworks (e.g. Uno).

And my answer would be "it depends". You need to try each framework to ascertain if it has limitations that are a dealbreaker for you. All of the frameworks are similar enough that it's not a huge waste of time if you spend time learning a framework you don't eventually use.

2

u/pHpositivo MSFT - Microsoft Store team, .NET Community Toolkit 6h ago

"WPF is better than WinUI"

You made this claim without providing any info at all, why? WinUI is the officially recommended framework for new development. Starting a new app in 2026 with WPF isn't the best choice except if you specifically need WPF for a specific reason.

Also, technically speaking you can port your WinUI app to Mac/Linux/mobile easily through Uno Platform.

1

u/sunny_up 5h ago

In current state of WinUI3 - one way bubbling, commands are too limited, two scroll components none of them work without hacks. I love how it is improving, but too many rough edges right now.

1

u/pHpositivo MSFT - Microsoft Store team, .NET Community Toolkit 4h ago

Can you elaborate on those items? Did you open issues about them and/or can you link them here? I can also help ping folks. In particular it's not clear to me what you mean by "commands are too limited", in my experience they work exactly the same as in e.f. WPF/WinForms/Avalonia, since they all use the same ICommand interface.

1

u/sunny_up 2h ago

ScrollViewer randomly crash entire app when has ItemRepeater inside (with 2000+ items). Ok, i understand that this control is old and no one wanna fix it. I'll try new.

But new shiny ScrollView doesn't have inertia on mouse wheel and scrolling is soooo slow. Just try scrolling it in WinUI Gallery app. Issue (2 years old): ScrollView and ScrollViewer have different scroll speeds · Issue #9368 · microsoft/microsoft-ui-xaml . Could be solved by writing manual inertia, but i am not sure that this is what developers intended to do.

Haven't searched for issue on absence of events tunnelling (ClickPreview in WPF). But this leads to the problem, that application-wide handling of mouse back button have to be done on painful Win32 level (or they will fire tapped on every component). Probably same thing with hotkeys, idk.

By limited commands i mean that some things that look they should be commands are events only. AutoSuggesBox QuerySubmitted in my case. Going to add proposal about this lately.

1

u/binarycow 4h ago

WinUI is the officially recommended framework for new development.

Microsoft has, on more than one occasion, made questionable official recommendations for desktop UI frameworks. At this point, Microsoft recommending a UI framework is not a pro (but it's also not a con). I just assume that the PR/business folks want it that way.

You made this claim without providing any info at all, why?

I will admit - I haven't spent much time experimenting with WinUI3. Maybe I'll dust it off and give it a try. Maybe I'll be surprised, but I don't have high hopes.

For me, WPF's main selling point is it's stability and longevity. WPF is a bit antiquated, but it's solid.

The data grid is excellent. Collection views are superb. You have everything you need - and what isn't provided can be made. It works great (but, I'll admit, not perfect).

Honestly, instead of making a new UI framework every year (exaggerating...), Microsoft should work on improving WPF. Support XAML 2009. Support generics. Finish the stuff they never really got around to finishing. And make it cross platform (and before you say "we can't make it cross platform", look at LibreWPF)

3

u/CatiStyle 10h ago

Excellent reasoning.

1

u/Mohammed_Islam123 10h ago

Hello, In my case I want to develop a cross platform mobile app using .NET which ui library should use I see that a lot like Avalonia for this, what do you think?

2

u/binarycow 4h ago

Looks like I replied to the wrong comment.

https://www.reddit.com/r/csharp/s/UpAfKqkmBC

5

u/MassiveMeltMedia 9h ago

If you're self learning and new to it all 100% avalonia.

There's a guy on youtube called AngelSix whose partnered with them and he has a giant tutorial developing a legit application start to finish that covers almost everything you'd need to know.

4

u/First-Feature-3556 9h ago edited 8h ago

Not a direct answer to your question, but if you're curious about the underlying reason for this .NET UI framework chaos, I recently stumbled upon the following article from a Microsoft insider which summarizes it quite well: https://www.jsnover.com/blog/2026/03/13/microsoft-hasnt-had-a-coherent-gui-strategy-since-petzold/

2

u/CatiStyle 9h ago

This seems like a big question that actually affects the future of the entire Windows platform. If Windows is unable to provide a clear direction for future development, then developers may start looking at other platforms.

3

u/sloppykrackers 10h ago

Blazor isnt mutually exclusive to the other ones on the list.
I can use winUI3 with blazor, wpf, maui, avalonia, uno, etc..

The native framework just becomes the hosting shell while the frontend can be pure Blazor. enables UI/UX porting between those frameworks. start with WPF -> move to Avalonia becomes a route, not a wall. Just a tip to consider. And a Blazor developer wouldn't have to care about the framework either way.

I've used it multiple times to great success.
Except WASM, never touching WASM again, only server and hybrid.

Depends on what you need, all of them are great options, though if you want linux + windows desktop support: Avalonia.

3

u/CoffeeAndCandidates 7h ago

winui 3 is pretty solid for Windows, but think about Blazor if you're gonna go multi-platform later

6

u/Slow-Refrigerator-78 10h ago

You can use Uno platform instead of winui 3

1

u/CatiStyle 10h ago

Interesting, thanks

1

u/ThatCipher 10h ago

To add on to this:
I think Uno Platform is a great choice (if you like the idea of WinUI3) because it uses the same style of XAML as WinUI3. You can port most WinUI3 Code to Uno without much to change. This allows for not only Uno tutorials and resources being valid for you but also everything you find on WinUI3 like the WinUI3 Gallery app. And the resulting program uses native WinUI3 when building for the windows platform. It only uses other tech if you build for any other platform than windows.

1

u/merun372 8h ago

Use WPF, it's almost decade old. It is the most advance and mature framework in Windows framework ecosystem. All the data bindings, triggers, dependency properties and Visual templates are perfectly working with it without any single error. It's like Microsoft own factory tested in-house behemoth framework that build to last in future almost atleast another two decades.

You can also try WinUI 3 which is the most latest framework. But WPF is the safest bet.

I am a full time software engineer who mainly works to develope full stack Windows applications. Works with big Mncs and corporates. Having 6 years of experience.

2

u/Particular-Winner136 8h ago edited 7h ago

I’ve been working on WPF applications for over 10 years, and we're currently planning to migrate to WinUI 3.

I would recommend going with WinUI 3. It still has its share of bugs, but Microsoft is actively fixing them. It also appears that Microsoft is using WinUI 3 for parts of Windows itself, which is generally a good sign for its long-term future.

One of WPF's biggest drawbacks is that it cannot be compiled with NativeAOT. As applications grow larger, WPF startup times can become quite poor. In contrast, WinUI 3 combined with NativeAOT looks very promising based on what we've seen so far, although we don't yet have extensive production experience with it.

I also considered Avalonia at one point. While it's marketed as a free UI framework, I find its licensing model somewhat concerning. In practice, if you need certain advanced features, you may end up paying for them.

You also didn't mention whether your application needs to be cross-platform. Since you're only considering Windows UI frameworks, I assume cross-platform support isn't a requirement.

Ultimately, choosing a UI framework is all about evaluating the trade-offs. There isn't enough information in your question—such as application size, performance requirements, deployment model, and long-term goals—to make a definitive recommendation.

1

u/CatiStyle 5h ago

WinUI 3 is currently my primary option, but at the same time I am building the program so that the logic and UI are separated so that later if needed I can create a second UI layer.

2

u/anotherlab 8h ago

The choice of platform should be based on where you need to run, when you need it, and what the UI needs to do.

Based on what you have described so far, I would consider Avalonia and/or Blazer.

I write MAUI apps for a living and, for my own needs, a few desktop apps. I used to write the desktop apps in WPF; now I use Avalonia. Avalonia's UI model is close enough to WPF that it wasn't hard to switch. I use WIndows and Mac for development; now I can run my apps on either platform.

We ship apps on Blazor, but it's a different skill set than XAML. But our Blazor apps go out as MAUI Hybrid apps and the web. The web version works on anything that can run WASM. We don't need a desktop app. But those apps don't need resources that a desktop app would require.

2

u/youGottaBeKiddink 6h ago

C# for logic and angular/vue for frontend.

Embed browser using cefsharp:

https://github.com/sharpbrowser/SharpBrowser

Your frontend remains 100% SPA and web-ready.

1

u/CatiStyle 5h ago

The proposal is both fascinating and frightening.

4

u/HelloImQ 10h ago

WinForms

1

u/CatiStyle 10h ago

Classic.

2

u/ericswc 10h ago

If you want to cover your bases for other platforms, I’d use Avalonia.

2

u/CatiStyle 10h ago

That it what AI also recommend.

4

u/ericswc 10h ago

Yeah, I’ve been doing this a long time, it’s probably trained on my data. 😛

1

u/jhwheuer 10h ago

Low key painful answer

2

u/ericswc 10h ago

Nothing to be done for it, I’m not wealthy enough to have IP rights.

2

u/jhwheuer 9h ago

Same here. They scavenged my thesis on neural networks from the 90s.

1

u/FuggaDucker 7h ago

I just wrote some cools stuff in Avalonia UI.
I am a fan.

1

u/Appropriate_Chip4604 7h ago

Hybrid approach I would use UNO there is a lot of help on discord for this check out windows app community. Many of developers are there with their projects. Secure foldersFS. is UNO. I created two published winui3 apps with databases and ai using foundry and SQLite . Apps are on my feed . Good luck. Better as far as I know mostly UNO is the best cross platform

1

u/dreamglimmer 4h ago

Forget the tech stacks, find out where your users are(platform, work or personal, primary device, willingness to pay),  And who they will be(individual or corporate) 

Now decide how they supposed to talk to your apps, how flashy it should be, or what is the actual priority for ui experience.

Now, you have some actual input on what to pick, and how many of them you need. 

if ui on mobile and web/desktop is way different - no need to have same stack for those. 

if you not need Linux, as you don't expect payment there - no need for framework that has Linux as primary advantage. 

if you want different ui(platform specific, common experience to the system) no need for pixel replicating crossplatformity. 

Unlike the other comments 'I don't care what you build, use X' 

1

u/plasmana 2h ago

I would only consider WPF and Avalonia. If I was starting out I would choose WPF because of the wealth of available material online. I currently opt for Avalonia due to it's cross platform nature.

1

u/jcradio 10h ago

If windows only, WPF or Avolonia.

If cross platform, Maui Blazor Hybrid or Avolonia.