Skip to main content
All docs

How to: Customize the AccordionControl Appearance

This example demonstrates how to use standard properties BorderBrush, BorderThickness, Background, and Foreground to customize AccordionControl and AccordionItem appearance.

You can use standard appearance properties to colorize the AccordionControl elements in versions 21.1 or newer.

Use either of the following techniques to apply appearance properties to the AccordionControl:

  • Specify properties directly

    <dxa:AccordionControl x:Name="accordion" 
                            BorderThickness="1" >
  • Define a style

        <Style TargetType="dxa:AccordionControl">
            <Setter Property="Background" Value="#fdfdfd"/>
            <Setter Property="BorderBrush" Value="#51555f"/>
            <Setter Property="BorderThickness" Value="1"/>

You can customize specific elements in a similar manner:

    <Style TargetType="dxa:HeaderPresenter" >
        <Setter Property="Background" Value="#e6f2fa"/>
        <Setter Property="Foreground" Value="Brown"/>
        <Setter Property="BorderBrush" Value="#51555f"/>
        <Setter Property="BorderThickness" Value="0,0,0,1"/>

View Example