2
votes

I am new to using wpf and want to use expander to allow the user to show and hide text. I want the expander container to be the entire length of the window height 800. I want to have the expander expand to the right and have the text and expander button be in the center of the expander.

I know how to make the expander expand to the right and how to change orientation of the text with a textblock. I can not figure out how to make the location of the text and the button move to the center of the expander.

Any help would be much appreciated.

1

1 Answers

4
votes

The good news is that this is possible... the bad news is that it is not as trivial as setting some property on the Expander to move the button around.

In order to create the effect you are after, you're going to have to write a custom ControlTemplate for the Expander.

Here's a nice tutorial showing you how to achieve this...