我无法理解属性描述符如何通过说获得两个不同绑定字段的属性.Find("boundField", true)
这是一个例子
PropertyDescriptor propertyA = TypeDescriptor.GetProperties(DataBinder.GetDataItem(control.NamingContainer)).Find("boundField", true);
PropertyDescriptor propertyB = TypeDescriptor.GetProperties(DataBinder.GetDataItem(control.NamingContainer)).Find("boundField", true);
两行代码都是相同的,当我调试它们时它们会返回null
,但是当我尝试像这样从中获取值时,它们会给出不同的值(这是正确的),这怎么可能?
PropertyAFieldValue = this.GetValue(control.NamingContainer, this._PropertyAField, ref propertyA).ToString();
PropertyBFieldValue = this.GetValue(control.NamingContainer, this._PropertyBField, ref propertyB).ToString();
对于其余代码,请查看此属性描述符如何使用相同的代码行获取两个控件的值?