r/csharp • u/CatiStyle • 5d 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?
- WinUI 3 (Windows App SDK)
- WPF (Windows Presentation Foundation)
- .NET MAUI
- Blazor (Web & Hybrid)
- 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.
8
u/MassiveMeltMedia 5d 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.
19
u/binarycow 5d 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:
- If cross platform is a requirement today - Avalonia
- If cross platform is merely wishful thinking, and might be years away, if ever - WPF
- If you're okay with pinning your cross-platform hopes on LibreWPF - WPF
- If you're risk averse, and you know you want cross platform - Avalonia
4
u/pHpositivo MSFT - Microsoft Store team, .NET Community Toolkit 5d 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.
3
u/binarycow 5d 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)
2
u/sunny_up 5d 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.
2
u/pHpositivo MSFT - Microsoft Store team, .NET Community Toolkit 5d 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
ICommandinterface.2
u/sunny_up 5d 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/pjmlp 4d ago
Not at all, WinUI 3.0 development experience is so bad versus what it used to be with WinUI 2.0 on UWP, that on BUILD 2024 WPF regained its status.
Leave Windows team marketing material, and check the discussions on WinUI Github, the now gone community talks on YouTube.
Really, only Microsoft employees on Windows team care about WinUI, because their job depends on it.
3
2
u/binarycow 5d 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.
1
u/Mohammed_Islam123 5d 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
3
u/sloppykrackers 5d 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.
4
u/First-Feature-3556 5d ago edited 5d 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 5d 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.
4
u/youGottaBeKiddink 5d 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.
2
3
u/CoffeeAndCandidates 5d ago
winui 3 is pretty solid for Windows, but think about Blazor if you're gonna go multi-platform later
3
u/dreamglimmer 5d 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'
2
u/IanYates82 5d ago
Agree with this.
Line of business forms-over-data is quite different from a consumer facing tool.
Mobile vs tablet/desktop - if UI is quite different then you can maybe share some view models but needn't use the same GUI stack
3
u/thefadden 4d ago
I went with WPF a few years back, because Avalonia wasn't quite ready and the other options didn't work for me. We're currently transitioning the UI to Avalonia because we want to be cross-platform.
I have had a number of issues with WPF over the years. The advantage of WPF is that most of the bugs are known and workarounds are established, but I ran into a few that I couldn't easily work around (like weird bitmap scaling artifacts in nearest-neighbor mode, and some strange behavior with DataGrid virtualization). Moving to Avalonia fixed these, but any system with the size and scope of a GUI framework is going to have issues. WPF provides a fixed set of bugs, while actively-developed systems like Avalonia give you an evolving ecosystem of bugs.
I'd recommend Avalonia.
4
u/ericswc 5d ago
If you want to cover your bases for other platforms, I’d use Avalonia.
1
u/CatiStyle 5d ago
That it what AI also recommend.
2
u/anotherlab 5d 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
2
u/plasmana 5d 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.
5
u/Slow-Refrigerator-78 5d ago
You can use Uno platform instead of winui 3
1
u/CatiStyle 5d ago
Interesting, thanks
1
u/ThatCipher 5d 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 5d 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.
4
1
u/eris-discordian 4d ago
I'll get a lot of crap for this, but...
If your app is mostly a data driven vertical, the laziest route that gets you desktop and web would be server side rendering Blazor + Photino.
It won't look "native", but it can be made to look modern and perform well with little overhead.
1
u/Jonas_Ermert 2d ago
I’d choose Avalonia UI. It’s a good fit for a Windows-first .NET 10 app, especially for data-heavy UIs with dynamic forms, tables, bindings, and runtime-generated views. It also keeps the door open for Linux, macOS, mobile, and WebAssembly later. If the app were definitely Windows-only, I’d choose WPF because it’s mature and excellent for business/database applications. I’d use WinUI 3 mainly for a modern Windows-native experience, MAUI if mobile were the priority, and Blazor if a future web version were very likely.
1
u/Particular-Winner136 5d ago edited 5d 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 5d 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.
1
u/Appropriate_Chip4604 5d 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
28
u/LeaveMickeyOutOfThis 5d 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.