Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been learning WPF, and I want to shoot myself. It looks pretty, and is very flexible, but it's just so much damn typing. Plus the errors you get out of it are often pretty useless.

Maybe my brain just doesn't get it, but the documentation makes me crazy too. I just hate everything about it.



WPF is a huge change from "traditional" UI frameworks like Windows Forms or Swing. It requires some rethinking and to get the most out of it you should really do things the WPF way in many (not all) cases, even though other options appear to work (they're just more work in the end and less flexible).

The documentation is actually fairly good in my eyes iff you're only writing applications. As a library and custom control vendor (a position I find myself in at work) it can be atrocious and sourceof.net is hugely helpful (and I still find myself wanting to debug framework source code at times).

Still, if you have specific questions, you can throw me an e-mail if you want.


I came to WPF having not touched WinForms for nearly a decade and I fell in love immediately.

Once you accept that reactive data models are the 'correct' pattern things become so much simpler.

Throw in JSON.net and QuickType (amazing if you haven't seen it, feed it JSON or JSON Schema and it outputs correct code to serialize to from JSON in about 25 languages pretty much idiomatically (for C# it uses JSON.net for TypeScript interfaces and if you want it runtime validation).

It's a remarkably stable way of hoisting an API.


I'd like to know more about this, can you recommend some good places to learn about it?


The actual principal is simple, your classes have private properties which contain the thing, you use get/set on public properties and on the set you raise a property change event (that's declared via an interface).

WPF binds to those objects and when you change the thing via a public property the change notification is fired and the UI updates.

Docs you want are MVVM and particularly INotifyProperyChanged.

https://www.c-sharpcorner.com/article/explain-inotifypropert...


Thanks, I appreciate the offer for help. If I get stuck again, you might hear from me =D

I think a lot of the problem probably depends on the work you're doing. I'm an engineer, usually I just want a GUI that shows me the information I need, I don't care much for design aesthetics beyond making sure it's not hideously ugly. Winforms was good for this, but it definitely looks dated and needed to be replaced or massively overhauled.

I can absolutely see how somebody doing more attractive design work would like WPF. It just makes me grouchy. Somebody else mentioned mixing blend into their workflow, maybe I'll take a look at that.


> but it's just so much damn typing.

Expression blend saves a lot of typing. Also if you provide design-time data, saves time because WYSIWYG gives faster feedback than change-build-test cycle.

When I work on XAML-based GUI, I open the project in both VS and Blend, and use them alternately.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: