> Have a look at my original API though
I noticed, but I find that style to be more confusing. Or at least, it's no better than my example that specifies the
obj variable directly since there's repetition in both.
In the original forum discussion the implemention of FromPropertyChangedPattern
was similar, but since then I've elliminated the need for having to bind the object in the expression function for two reasons:
- Simplify the API.
- Support chained field/property syntax. For example:
var fooChanged = Observable2.FromPropertyChangedPattern(() => obj.Foo.Bar.Baz);
The recommended overload of FromPropertyChangedPattern automatically detects the object returned by
Bar and uses it to acquire property changed notifications for
I included the legacy syntax anyway as an overload of FromPropertyChangedPattern, but perhaps we should remove it entirely. It seems to me that adding this extension to
INotifyPropertyChanged will just add some confusion and a subset of the functionality that
FromPropertyChangedPattern offers, so perhaps we should just stick with one recommended implementation.
Still though, is FromPropertyChangedPattern really that complicated to use now? I'm not sure it's worth our time to add this feature since there's very little value in it, if any.