+1. NotifyPropertyWeaver is the closest thing to "it just works", short of the 
C# team actually caring about what the language is used for beyond Fibonacci 
sequence calculators in console apps.


From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Chris Walsh
Sent: Wednesday, 23 March 2011 12:59 PM
To: ozDotNet
Subject: RE: Raising property changed events

Apparently (according to Brendon Forster :)) All the cool kids are using this.

http://code.google.com/p/notifypropertyweaver/



From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of David Burela
Sent: Wednesday, 23 March 2011 1:57 PM
To: ozDotNet
Subject: Raising property changed events

Raising property changed events seems like something that most applications 
need to do at some stage. C#3 introduced the auto property i.e. public bool 
IsBusy { get; set; }
I am surprised that there isn't a way built into the framework to automatically 
raise changed events


Anyway, i saw this code used at a client site. it seems like a smart way to 
handle the raised event without using fragile strings that might not get 
updated when you change the property name

private bool isBusy;
public bool IsBusy
{
    get { return isBusy; }
    set
    {
        isDialogProcessing = value;
        
RaisePropertyChanged(System.Reflection.MethodBase.GetCurrentMethod().Name.Substring(4));
    }
}


Thought I'd throw it out there. See how other people are handling property 
changed events in their own projects.
I'm sure there is an AOP way of introducing them. But all the AOP demos I have 
watched seem to increase compilation times by heaps.

-David Burela

Reply via email to