07-13-2012 10:27 PM
I am developing a field-bound control that should be available for placing on any Entity layout, in the Layout Designer. I am now up against a problem that I cannot find a mention of in any blog, news, or documentation anywhere.
The control is basically a 'MutableEntity' type. I can make it work on for instance a Contact layout by declaring the Designer as 'ContactFieldBoundControlDesigner' in the control's class Attributes. However it remains available in the Designer Toolbox no matter what type of layout is being edited. Placing it on a layout other than a Contact layout can be done, but it will not work, as the Designer always supplies a list of Contact fields only for connection to it, and of course if the other-than-Contact layout is then displayed at run-time, the Contact field it wants to connect with is not avialable to it.
Declaring the Designer as 'MutableEntityFieldBoundControlDesigner' fails because the list of fields offered for connection at design-time is empty.
I could make four tools - one for each Entity type, but they will all always be available in the Layout Designer Toolbox, no matter what type of layout is being edited. What I really want is one tool that the Layout Designer will supply with a choice of fields that depends upon the layout being edited, not the tool!
Any ideas as to how to achieve that would be most welcome.