Go through this article -
http://www.dotnetperls.com/expander[
^].
var expander = sender as Expander;
this.Title = expander.Header.ToString();
While this does not answer your question completed, what you can do is capture the sender.
Then get the first child of that header using
GetVisualChild[
^].
Once you have the header control, add the stack panel.