Question

PropertyDescriptorPropertyModel doesn't implement IConvertible

Posted 24 days ago by Avatar Antoine Picard

Hi,

I created a simple custom editor for IList properties with a button. It's the same as the basic IList behavior but as I want to handle what's happening when I click on the button, I decided to create my own editor.

When I click on the button, I'm trying to retrieve the corresponding property in the event in the code behind but everything is wrapped in PropertyDescriptorPropertyModel... I managed to get this using the RoutedEventArgs e as ((Button)e.OriginalSource).DataContext; but I struggle to retrieve the exact object with the right type... I found the type in ValueType property but as PropertyDescriptorPropertyModel doesn't implement IConvertible, I can cast my property to its right type...

I don't know if I'm clear enough but am I missing something ?

Antoine P

Information The latest build of this product (2018.1 build 0672) was released 2 months ago, which was before this thread was created.

Comments (2)

Posted 23 days ago by Actipro Software Support - Cleveland, OH, USA

Hi Antoine,

The PropertyDescriptorPropertyModel basically wraps a PropertyDescriptor.  Its ValueType property returns "propertyDescriptor.PropertyType".  And its Value property gets/sets the reflected property's value on the property descriptor.  Thus you can get/set the PropertyDescriptorPropertyModel.Value to retrieve or change the property.  Is that what you need?


Actipro Software Support
Posted 12 days ago by Antoine Picard

Hi !

that's exactly what I was looking for !

Thanks a lot !

Antoine P


Add a Comment

Please log in to a validated account to post comments.