Dan*_*nte 7 c# reflection propertychanged
我在C#工作,我有一个我只能使用的对象Reflection(出于某些个人原因).所以,当我需要为其中一个属性设置一些值时,我会按如下方式执行:
System.Reflection.PropertyInfo property = this.Parent.GetType().GetProperty("SomeProperty");
object someValue = new object(); // Just for example
property.SetValue(this.Parent, someValue, null);
Run Code Online (Sandbox Code Playgroud)
并且,为了获得它的价值,我使用了这个方法GetValue.
我的问题是:当使用Reflection更改属性时,是否有办法触发事件?