Conversation
|
Looks very good, thanks. I also started working on it because I finally got it to build on my home machine, but I didn't add any tests. You can take a look at the equality check for example. I also inlined |
|
Great. I was uncertain my equality check would be adequate. There's multiple things to consider. I'll brainstorm here with you later... gotta run for now. |
|
I think when the property value has a reference type, it'll be crucial that the field is updated and the event raised any time the reference changes, regardless of value equality between the two references. The reason is consumers such as WPF data binding can hook the value itself for its own property changes if it is a reference type, and if the reference changes, WPF has to reset all its subscriptions. When the property is over a value type, the setter should either always assign the value and raise the event, or have an equality comparer that really works. An overridden |
|
Looking more into this, I see the immutable types' |
|
I proposed using
Your argument about WPF having to reset its bindings is very interesting. I wonder how MVVM libraries are dealing with this or if this is a known problem at all. |
|
I'm willing to bet that these other libraries may not be adequately tested enough to notice the bugs that they incur when using reference types in their fields with types that implement INPC themselves. |
…ther structs define == operator
|
OK, in its final form, property setters have at least 3 unique sets of conditions (plus no condition at all) based on the type of field the property setter is for. @eggapauli if you're interested in pursuing the EqualityComparer question with the other MVVM frameworks you found, I'll describe a repro for a bug that I suspect they all have if you want to verify it and file bugs against them. |
|
Ok, super, thanks for implementing this. I'll see if I can reproduce it myself, thanks for the help. |
Fixes #78