Raise an event when a property is modified using Reflection

I work in C #, and I have an object that can only be accessed with Reflection(for some personal reasons). Therefore, when I need to set some value for one of its properties, I do it as shown below:

System.Reflection.PropertyInfo property = this.Parent.GetType().GetProperty("SomeProperty");
object someValue = new object(); // Just for example
property.SetValue(this.Parent, someValue, null);

And to get its value, I use a method GetValue.

My question is: Is there a way to fire an event when a property is changed using Reflection?

Thanks in advance.

+5
source share
2 answers

Is there a way to fire an event when a property is changed using Reflection?

, , . "" , .

+7

Inotifychanged WPF.. , - ,

0

All Articles