views:

326

answers:

1

Is there a way to do this:

I need to develop the easiest way to support registering to property changes of some class. Apart from manual way of adding INotifyProperyChanged support, is there a way to do it like this:

class Base ... // all notification logic here

class Child
{
    public string Name { get; set; }
    public int SomeNumber { get; set; }
    // etc....
}

so that I can do Child.PropertyChanged += some_handler and be notified only on Child property changes. This isn't for NHibernate, or anything else, it is for manual use in entire project. I have looked into some examples of doing this with Castle Dynamic Proxy (like here), but I don't understand how to exploit it :(

Sure would like to explore there frameworks and AOP in general, I just don't have enuogh time right now ...

Thank you in advance for any comments...

+2  A: 

Proxies or AOP really are your only options for doing this automagically, so you will need to either find the time to investigate or do it the good old-fashioned way.

HTH, Kent

Kent Boogaart