Styles
In order to change the appearance of visual elements, a Style can be applied every visual block. A Style is a collection of all graphical properties used in rendering visual blocks. Styles follow these rules:
- A Style that is applied to a block, is automatically applied to all child elements. So by setting a Style to the VisualBook element, all elements in that book will use this Style.
- Styles are "cascading": a Style of an element always inherits from the style of its' parent. If none of the ancestors define a style, the default style (skin based) is used. Only the style elements that are defined, will override the parent style.
For example
<Style Name="pagestyle" TextColor="#FF0000" TextStyle="BoldItalic" PageBackgroundSolid="#00FF00" PageBackgroundFillMode="Solid"/> <Style Name="buttonstyle" TextColor="#FFFFFF"/> <VisualBook> <VisualPage Style="pagestyle"> <VisualContent> <VisualText Text="Normal text"/> <VisualButton Style="buttonstyle"> <VisualText Text="button text"/> </VisualButton> </VisualContent> </VisualPage> </VisualBook>
This yields following result:
