I am writing a library and my clients using my library.
My clients creates own classes derived from my base class.
Can i detect my client's class property is changed?
I don't want my clients to implement INotifyPropertyChanged.
I am also using reflection for other purposes. Why reflection can't detect properties change status?
My library code:
public class BaseClass
{
public void ChildPropertyChanged(propinfo...)
{
...
}
}
Client's code:
public class MyClass : BaseClass
{
public string Name {get;set;}
}
Your clients must collaborate, meaning they will have to write code to help you catch the change of properties, as in INotifyPropertyChanged clients (implementers) must raise an event (RaisePropertyChanged);
If you think about it, if what you are asking was possible, than INotifyPropertyChanged was not necessary..
One possible solution for you is to define an event in the base class, and guide your clients to raise it in their properties getters, or even better - calling a base class handler method.