Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to TypeDescriptor in Silverlight 3?

Tags:

c#

Am using this code in WPF to check for properties.

if (TypeDescriptor.GetProperties(this)[propertyName] == null)
{
      //some code 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.

like image 418
Joker Avatar asked Nov 27 '25 08:11

Joker


1 Answers

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.

like image 149
Jon Skeet Avatar answered Nov 29 '25 23:11

Jon Skeet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!