views:

225

answers:

1

I am using the WPF expander like a drawer, it expands up out so that the header remains above the content. When it is collapsed the grid cell that it is in is made smaller as well.

I want the expand direction to remain down so that the content fills in below it, however because it moves up it would look better if the icon with the directional arrow were in the opposite direction as if the ExandDirection property were set to Up. How can this be done in either C# code or in the XAML.

Thanks

A: 

If I understand correctly that you want to swap arrows for expander collapsed/expanded state, you'll need to create a custom control template for expander. The easiest way I know to do that is to get expander control template from wpf theme and rename styles:

  • ExpanderUpHeaderStyle to ExpanderDownHeaderStyle
  • ExpanderDownHeaderStyle to ExpanderUpHeaderStyle

You can download themes sources from here http://msdn.microsoft.com/en-us/library/aa358533(VS.90).aspx

If you'll have any issues with that, let me know what wpf theme are you using and I'll make you the xaml.

Also have a look how to customize Expander with Blend http://www.c-sharpcorner.com/uploadfile/dpatra/807/default.aspx

Andrii V