Search code examples
wpfexpandercornerradius

Altering border's corner radius on WPF Expander control?


Very high up the visual tree in WPF's Expander control is a border element (see screenshot). By default this has a CornerRadius of 3. Is it possible to modify this value?

enter image description here

enter image description here


Solution

  • I'll leave marking as answer for now but I managed to implement the solution as follows:

    Using stylesnooper I obtained the style / control template used for the 'standard' Expander control.

    Then after discovering it didn't quite behave as expected, figured out that the line <ToggleButton IsChecked="False" ... is wrong and should actually be <ToggleButton IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"...

    Everything then worked as expected.