Skip to main content

WpfSvgPalette.States Property

Allows you to create certain palettes for specific states.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v23.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public Dictionary<string, WpfSvgPalette> States { get; set; }

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 Images topic for more information.

See Also