我在http://code.msdn.microsoft.com/windowsdesktop/Validation-in-MVVM-using-12dafef3上找到了MVVM的验证示例。
我正试图在我的Silverlight 5项目中使用它。挑战是Silverlight 5在其TypeDescriptor dll中没有ComponentModel。
http://lostechies.com/jimmybogard/2010/02/19/automapper-for-silverlight-3-0-alpha/
所以,我如何使用它,或者有什么工作要做。我对倒影不太了解。
请指点。
var propertyDescriptor = TypeDescriptor.GetProperties(GetType()).Find(propertyName, false);
if (propertyDescriptor == null)
{
throw new ArgumentException("Invalid property name", propertyName);
}
value = propertyDescriptor.GetValue(this);
_values.Add(propertyName, value);发布于 2015-07-07 10:31:32
为什么不使用xxx.GetType().GetProperties()?
https://stackoverflow.com/questions/24837116
复制相似问题