3 ms·
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' patte
by noir_lord 8y ago
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.
- ac0kg 8y agoI'd like to know more about this, can you recommend some good places to learn about it?
- noir_lord 8y agoThe 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-inotifypropertychanged-in-wpf-mvvm/ https://www.c-sharpcorner.com/article/explain-inotifypropert...