There are 3 entries for the tag DataBinding
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)

Property Changed Events

When creating a class that can be used with data binding, you have to implement the INotifyPropertyChanged interface.  This interface requires that you have an event for PropertyChanged, specifying PropertyChangedEventArgs that provide the property name that was changed. Here’s what I mean: 1: public class Person : System.ComponentModel.INotifyPropertyChanged 2: { 3: private string _name; 4:  ...

posted @ Thursday, June 19, 2008 1:47 PM | Feedback (4)