INotifyPropertyChanged

There are 3 entries for the tag INotifyPropertyChanged
Member.Of – Avoiding hard-coded strings for property names

In the hallways of building 42, several of us have talked about how often we need to hard-code member names as strings in code, but we always feel like there should be some language operator to do this.  We’ve specifically said there should be a memberof() in C# the same way there’s a typeof() operator. I got tired of waiting for it though, and decided to see how closely I could come to creating this behavior.  What sparked it was my usage of NHibernate’s Restrictions class tonight.  I was looking at a post on Ayende’s blog showing examples of...

posted @ Saturday, April 10, 2010 3:32 AM | Feedback (8)

INotifyPropertyChanged - Extension Methods

One of the approaches I've tried using to combat the PropertyChangedEventHandler nuisance is an extension method on INotifyPropertyChanged.  Actually, a pair of them.  One accepts a single property name and the other accepts a param array of property names, so that events can be fired for multiple events succinctly. 1: /// <summary> 2: /// Raise the specified PropertyChangedEventHandler for the sender 3: /// and property name, but only when the handler is not null ...

posted @ Tuesday, October 7, 2008 9:05 PM | Feedback (5)

INotifyPropertyChanged -- Searching for a Better Way

I've been fiddling with different approaches for implementing INotifyPropertyChanged.  I blogged one approach awhile back, declaring my unhappiness with the pattern.  Neil Mosafi also talked about how INotifyPropertyChanged might be an anti-pattern.  I keep searching for a better way. At last night's Nerd Dinner, Brian Henderson was talking to Glenn Block and me about this problem.  He suggested a language feature of some sort, with perhaps the feeling of generics.  He mentioned that there really isn't anything to make properties easier, other than the automatic properties of C#, but those aren't very flexible. I crafted a syntax that...

posted @ Tuesday, October 7, 2008 5:02 PM | Feedback (2)