views:

324

answers:

1

Right now I have a Stackpanel, that contains a collapsed Expander, and a Listbox.

The Listbox beneath the collapsed Expander is being positioned as if the Expander was expanded. Is it possible for the StackPanel to dynamically do layout based on the collapsed size of the Expander, and then on the Expanded size of the Expander once it's been clicked on?

Thanks for your help.

+2  A: 

After a bunch of documentation reading, I determined what my problem was.

If you explicitly set the height of the Expander (in a vertical layout) then it will always use that size in a StackPanel. If you set the height to "Auto" then it will use the contents of the Expander for the expanded size, and the collapsed size of the Expander when it's collapsed.

John Noonan