WpfSvgPalette.States Property
Allows you to create certain palettes for specific states.
Namespace: DevExpress.Xpf.Core
Assembly: DevExpress.Xpf.Core.v18.2.dll
Declaration
Property Value
Type | Description |
---|---|
Dictionary<String, WpfSvgPalette> | A collection of WpfSvgPalettes. |
Remarks
You can change colors for a certain theme:
- Create the WpfSvgPalette class instance and add it to the
WpfSvgPalette.States
dictionary. - Specify the state’s Key to the theme name.
- Define a Brush to replace colors.
The code sample below shows how to change color from #333333 to #FFFFFE for the Office2016Black theme:
<Image Source="{dx:SvgImageSource Uri=Images/atc-logo.svg}"
dx:SvgImageHelper.State="{Binding Path=(dx:ThemeManager.TreeWalker).ThemeName, RelativeSource={RelativeSource Self}}">
<dx:WpfSvgPalette.Palette>
<dx:WpfSvgPalette>
<dx:WpfSvgPalette.States>
<dx:WpfSvgPalette x:Key="Office2016Black">
<SolidColorBrush x:Key="#333333" Color="#FFFFFE"/>
</dx:WpfSvgPalette>
</dx:WpfSvgPalette.States>
</dx:WpfSvgPalette>
</dx:WpfSvgPalette.Palette>
</Image>
If a state-specific palette is not specified, the root palette is used.
Refer to the SVG Image Palettes topic to learn more.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the States property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.