0

Possible Duplicate:
WFP combine expander and grid (resizable expander)

I'm sure there's an easy answer to this question, but I'm not seeing it.

I'm laying out a Grid that contains three columns. The first contains an Expander whose ExpandDirection is Right. The second is a GridSplitter. The third contains a DockPanel full of stuff.

The goal is that when the Expander is collapsed, the grid column is the width of its header. When it's expanded, the user should be able to change the width of the expanded area by dragging the GridSplitter.

I can't figure out the right way to do this. Dragging the GridSplitter changes the width of the column, and I don't really want to change the width of the column, I want to change the maximum width of the expander. I can't figure out how to implement an expander with a maximum width that can be changed by dragging, though - at least, not without writing a bunch of code.

Any idea? Can this even be done in straight XAML? Is it just blindingly obvious?

Community
  • 1
  • 1
Robert Rossney
  • 94,622
  • 24
  • 146
  • 218
  • 1
    Try placing the splitter in the expander, as shown [here](http://stackoverflow.com/questions/5553383/wfp-combine-expander-and-grid-resizable-expander/5554283#5554283). – H.B. Aug 18 '11 at 22:40
  • When the `Expander` is *closed* do you want it to *expand* when the `GridSplitter` is moved? or the `GridSplitter` only active when the `Expander` is *expanded*? – Dennis Aug 18 '11 at 22:42
  • Ignore my comment, H.B's answer is correct. Voting to close this question as a duplicate. – Dennis Aug 18 '11 at 22:44
  • I would have found that if I'd looked harder. And it's exactly right. Closing gets my vote. – Robert Rossney Aug 19 '11 at 00:02

0 Answers0