开发者

Alternative to TypeDescriptor in Silverlight 3?

Am using this code in WPF to check for properties.

if (TypeDescriptor.GetProperties(this)[propertyName] == null)
{
      //some c开发者_开发技巧ode here...
}

I want to use the same logic in Silverlight 3, but there is no TypeDescriptor. Anyone knows an alternate way to do it in Silverlight.


Any reason not to use Type.GetProperties / Type.GetProperty?

PropertyInfo property = GetType().GetProperty(propertyName);
...

I know they're not quite equivalent, but if you're dealing with a "normal" property it may well be close enough.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜