It is possible to simplify the user interface definition a lot with the help of styles.
In many cases control definitions are repeated with the same properties in many different panels. A typical example is a reject button that is usually defined in almost all panels because the customer shall be able to abort the purchase at any time. The reject button usually has the same look, size and position in all panels so the customer will easily find it and understand what the button does.
In this case is it convenient to define a style for the reject button and set all properties in the style. When a reject button is declared, a style can then be referenced and all properties in the style will automatically be applied to the button. This simplifies the user interface definition because the declaration of every reject button is more compact.
The biggest gain, however, is that every reject button can be changed simultaneously in the future just by changing the style.
It is recommended to define a style if two or more instances of a control will be created with the same property setup in the user interface.
Continue reading