Nevron Open Vision Documentation
UI Themes Overview

The base class of all NOV UI themes is the NUITheme class, which derives from NTheme. This means that NOV UI is generally styled with DOM themes, which are described by the Themes topic.

Currently there are two general types of UI themes as seen from the following image:

 

The NUITheme class defines the most commonly used UI states and contexts that are used by UI themes. The UI theme also exposes two maps:

Both maps are initialized from a value of the ENUIThemeScheme enumeration, which defines the basic color and font presets for a UI theme. Vector themes (such as the NWindowsClassicTheme) typically use only these template resources to construct the theme. Image themes (themes derived from the NImageSkinsTheme) additionally use images to define the appearance of certain UI elements.

The NUITheme also provides abstract methods that should style a specific type of widgets (e.g. CreateWindowStyles(), CreateButtonStyles(), etc.). When you create custom themes, you should override all of them if you inherit from NUITheme or the ones you want to style yourself, if you inherit from one of the NUITheme derived themes. The following example overrides the buttons of the default Windows Aero theme:

Custom Theme Example
Copy Code
public class MyCustomTheme : NWindowsAeroTheme
{
    public MyCustomTheme()
    {
    }
    protected override void CreateButtonStyles()
    {
        // buttons are yellow by default and with 1 dip border
        NThemeSkin skin = GetSkin(NButtonBase.NButtonBaseSchema);
        skin.Set(NWidget.BackgroundFillProperty, new NColorFill(NColor.Yellow));
        skin.Set(NWidget.BorderThicknessProperty, new NMargins(1));
        // buttons have a red border when pressed and blue background
        NThemeStyle pressedStyle = skin.GetStyle(IsPressedState);
        pressedStyle.Set(NWidget.BackgroundFillProperty, new NColorFill(NColor.Blue));
        pressedStyle.Set(NWidget.BorderProperty, NBorder.CreateFilledBorder(NColor.Red));
    }
}
The NOV Themes are available in FULL SOURCE CODE upon request. Please contact us at support@nevron.com if you would like to receive them. The easiest way to build a custom theme is to simply modify one of the existing ones.
See Also

DOM

Send Feedback