How to specify multiple formats for a control conditionally
Many end users want to highlight a control on the screen with different colors according to the value of the property bound with the control.
The common approach is defining multiple controls that are bound to the same property and specify different format for each control, then using a visible when rule to handle which control to be displayed at run time. However this approach makes a section rule not easy to comprehend and the value of WYSIWYG editor is undermined.
***Updated by moderator: Lochan to close post*** This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
I'm not sure how you can expect that WYSIWYG during editing since you don't know the value the property will have.
However, perhaps a fairly simple way to do this is to make several copies of a small section, each of which displays the property with the same control but with different choices for the control's parameters.
Then, from an outer section, include all the copies of the small section, but with visible-when conditions on each inclusion so that only one copy is visible, according to the property's value.
At design time we can not expect the section editor renders the format of a control dynamically according to the value of the property bound to the control. However the section editor is (and should be) able to display the default format of a control at design time and it is better than displaying multiple controls at design time for a single property.
I don't think creating multiple sections for a single property is an easier way than just defining multiple controls for a single property.
The reason I think creating multiple sections is easier than creating multiple controls is that the visible-when feature of the design layer makes it easy to show or not show a section, but I don't know if it's as easy to make it use or not use a control. /Eric