Class ThemeBuildingExtensions
- Namespace
- Icy.Configuration
- Assembly
- IcyUI.dll
Builder extensions for the theme: a theme from a file, or the built-in theme extended by one.
public static class ThemeBuildingExtensions
- Inheritance
-
ThemeBuildingExtensions
- Inherited Members
Methods
ExtendDefaultTheme(IThemeConfigurationBuilder, string)
Layers the resource dictionary in the file at path over the built-in theme.
public static IThemeConfigurationBuilder ExtendDefaultTheme(this IThemeConfigurationBuilder builder, string path)
Parameters
builderIThemeConfigurationBuilderThe theme section of a configuration builder.
pathstringThe file, relative to the configuration's assets, such as
Themes/MyGame.xml.
Returns
- IThemeConfigurationBuilder
The same section, for chaining.
Remarks
- The file's resources win over the built-in theme's under the same key.
- An implicit style in the file builds on the built-in style for its type: it keeps the built-in template and visual states and changes only what it sets, as a style in a page's resources does. A style with its own BasedOn, or ReplacesTheme set, is left as written.
-
Only styles declared directly in the file are chained. A style in a dictionary the file merges in with
MergedDictionariesis not: it replaces the built-in style for its type, as with ReplacesTheme. - Types the file doesn't style keep the built-in style.
A theme is chosen at startup: canvases take it when they're created.
UseThemeFile(IThemeConfigurationBuilder, string)
Uses the resource dictionary in the file at path as the theme, instead of the built-in one.
public static IThemeConfigurationBuilder UseThemeFile(this IThemeConfigurationBuilder builder, string path)
Parameters
builderIThemeConfigurationBuilderThe theme section of a configuration builder.
pathstringThe theme file, relative to the configuration's assets, such as
Themes/Dark.xml.
Returns
- IThemeConfigurationBuilder
The same section, for chaining.
Remarks
The file is a markup ResourceDictionary loaded when the configuration is built. It replaces the built-in theme entirely: controls get only the styles and templates the file gives them. To change a few things and keep the rest, use ExtendDefaultTheme(IThemeConfigurationBuilder, string).
A theme is chosen at startup: canvases take it when they're created.