Changing the form background

The Style
The following styles change the background of the form. You will see that as opposed to just putting the color directly on the Background property I have kept as a separate resource. This is done in order to structure my themes in a way that offers the user a choice of color schemes, without having to re-write the real meat of the theme for each color. How exactly this is done will be discussed in another article.

Where to put it
Above we have the two XAML snippets that will change the form background. In order for SB/XA to know about and use this XAML it has to be included in a theme. This can be done using one of two methods, either put the XAML directly into the theme, or put the XAML in a separate file and include it in the theme;

Option 2 (Referenced from theme file)

 * Create a file in xxTHEMES called FormBackground.xaml
 * Put the XAML snippet for the background in the FormBackground.xaml file


 * Create a file in xxTHEMES called FormBackgroundTheme
 * Add the ResourceDictionary tags and namespace mappings


 * Add a reference to the FormBackground.xaml


 * Refer to the tutorial Creating your first theme in order to define the theme and let SB/XA know to use it.

Create a reference to the style from SB/XA
Styles can be placed in a number of places, i.e. at the account level, SB/XA instance level, SB/XA system level or at the control level. In this case, because I want to create consistancy in my application I am going to put the style 'WikiFormStyle' at the account level.



What it looks like
And finally the results

This style was tested in 6.0.1.2135