StrataFrame Forum

Create Descriptor

http://forum.strataframe.net/Topic3477.aspx

By Kevin Lingofelter - 10/10/2006

When creating custom code, I have the option "Create Descriptor" selected. When I run the app, I get an error that says I may be missing a custom descriptor.

With this option selected, do I still need to do this? If so, what does this option do?

By StrataFrame Team - 10/10/2006

That is a pending fix, actually... the BOMapper isn't creating the property descriptors, even when the Create Descriptor option is checked.  I'll have to debug it, because the code for the code generation is correctly testing on the property. 

However, there is a workaround for custom properties.

using MicroFour.StrataFrame.Business;
...

protected override FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()
{
    return new FieldPropertyDescriptor[] { new ReflectionPropertyDescriptor("MyProperty", typeof(MyBusinessObject)) };
}

You have to do this whenever you create a custom property that is not part of the designer file if you want to be able to bind to the property.

By StrataFrame Team - 10/10/2006

OK, it was creating the descriptor properly when the checkbox was checked, but it was not adding the descriptor to the PropertyDescriptors collection within the business object, so I corrected the problem and it will be in the next update.  But, like I said, that workaround will work until we get you another update.