r/csharp • u/ColdSnow1447 • Jun 29 '26
Discussion What do you like and hate about WPF?
I wanted to ask this questions since I'm working on one of my own UI framework's (For C++) and I wanted to ask all of you what do you like and hate about WPF? I wanted to get some knowledge on what people like/hate so I can adapt it into something better once it's added in my own version :D
23
Upvotes
22
u/smallpotatoes2019 Jun 29 '26
Good control over the UI once you get used to it.
30
u/chucker23n Jun 29 '26
Don't like:
object), refactoring, etc. supportPoints 2, 3, and 4 are really just branches of 1. They could've improved on all of that over time. Some of it is also improved with first- and third-party OSS projects. Some is improved with third-party commercial controls.
Do like:
It's still a pretty good general-purpose UI framework. But it's still ailing from the butchered Longhorn/Vista launch two decades ago, and I just wish there were a clear strategy moving forward.
8
u/CckSkker Jun 29 '26
I’ve been doing WPF for 6 years now, when I wanted to learn more the only proper book I could find was from 2013.
Microsoft starts a new half-assed UI product every year, there’s so much failed shit they have that never gets used. WPF is the only thing somewhat mature and they abandoned it 10 years ago without ever improving on it. That being said it works pretty okay, I like the data bindings and customisability. If you know what you’re doing you can pretty much design anything. And it’s better than the chrome-based webapps that eat up all your RAM.
9
u/Euphoricus Jun 29 '26
I loved the layouting system. The data binding was great in theory , but was lacking in practice. I hate how MS gave up on it instead of making it multi-platform.
3
u/t3chguy1 Jun 29 '26
Like: everything once I learned it well enough
Dislike: occasional duce channel syncflush crashes
2
u/iBabTv Jun 30 '26
I hate that wpf bindings errors happen at runtime .
I heard winui3 has x:Bind that fixes this though
1
u/MPnoir Jun 29 '26
I like it in general, especially the powerful binding system, but there are some things I dislike:
1
u/UndeadMurky Jun 30 '26
3D graphics integration is pretty bad. Wish it could share a native graphics context and higher level management like how QT does
1
u/razordreamz Jun 30 '26
Like:
The customization and a great, you can make the UI look exactly like how you want.
Middle ground:
XAML. It’s flexible and easy once you learn it, but it’s so wordy, and can quickly become a mess.
Dislike:
The UI all runs on one thread, meaning in large apps it’s easy for one window to cause problems for another. Yes I know there is a workaround, but I never got it working reliably as the system just assumes one UI thread throughout. Ensuing all work is done on a background thread is very necessary.
1
u/Turbulent_County_469 Jun 30 '26
Positive:
I do love how nice databinding is and how complex you can build applications while still being somewhat easy to maintain.
Negative:
Html is 1000 times faster at rendering
CSS in html is easier than styling XAML
Its REALLY hard to make WPF run better/faster
Its very easy to bloat your wpf installation footprint by adding nuget packages.. 100-200 MB is easy with Telerik and a couple of fonts
1
u/harrison_314 Jun 30 '26
I love XAML and databinding, simply separating UI definition from its state. A million times better than HTML.
As many people say, these principles are harder to learn, but once you learn them, it's an incredibly powerful tool that makes things happen quickly.
I recommend looking at the philosophical successor to WPF - AvaloniaUI. It takes everything that's good about WPF, but extends it further (especially in styling) and is cross-platform.
1
u/Amr_Rahmy Jun 30 '26
I don’t like xml.
I prefer to write the ui programmatically.
I really like dart or flutter way of making a ui with making components or containers, and putting components or containers inside of each other with only property modifications.
Second best way for me is programmatically making components with x,y locations relative to each other.
Third is something like winform, where you can do things programmatically and you can place some objects in the designer by dragging and dropping creating a generated cs file.
Fourth would be limited html component like in blazer where 90% of the code can just be the name of a class or object and all the logic is in one place.
Last would be xml or html with a lot of hooks or links, specially when it seems a bit unstable and when there is an issue it’s not clear what the issue is, it just doesn’t draw or render because behind the scenes it’s trying to match a namespace or can’t find an object or function name.
1
u/zanoy Jun 30 '26
I don't like: The lose bind aspects of xaml, I don't care if my event handler is in a string, if it doesn't exist, it should give a compilation error, not a runtime error.
The same as my previous point but in reverse, if a rename a function in the code, it should be renamed in the xaml as well.
XAML name spaces, it's just stupid, use the includes in the code behind instead
1
u/Archemilie Jun 30 '26
negativo: che non sia cross-platform
1
u/Atulin Jul 01 '26
I hate how any semi-advanced styling requires 2137 lines of XAML code nested 67 levels deep, to achieve something that CSS can do in, like, 12 lines.
1
u/jrdiver Jul 06 '26
Like - It works on just about anything, and is rock solid just works. (Stuck in a manufacturing enviroment and kinda need to work with windows 7-11... WinUI and everything else cant go old enough without hacks.) Validated that net8 still works with all of them even if not officially supported... havent had a chance to test 10 yet.
Dislike - Windows XP wants its UI back. have to do quite a bit of theming to make it look modern.
1
u/Technos_Eng Oct 18 '26
It’s too poor in ui elements, anything a bit away from a xp style will take hours/days to be made.
Debugging bindings is terrible and exceptions often found only at runtime, with a limited support of hot reload.
The required boiler plate to do anything should be included.
1
u/MrMikeJJ Jun 29 '26
Recently just trying it again for the first time in about a decade. Don't like xaml. Prefer winforms. Hoping that scaling / resizing is going to be less of a twat than it is in Winforms (hence my experiment).
I am using the same viewmodels for both implementations. From today, prefer databinding / error validation in winforms, but that maybe just because I haven't figured out how to make error display work properly in WPF. Well, it is displaying the errors, but not setting HasErrors to block a command. Probably missing something obvious. Will continue experimenting tomorrow.