I would like to have something like a resizable Expander. My basic idea was something like this:
<Grid HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="2" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Expander Grid.Column="0" ExpandDirection="Right">
...
</Expander>
<GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
...
</Grid>
The problem with this: if i move the grid splitter and collaps the expander i got a big empty area. How can make the entire column collapse? Or is there another way to make the expander "resizable"
Not sure what you are trying to accomplish but i think conceptually the
Grid
should be part of theExpander.Content
, would this work for you?Edit: Removed all the triggering from the first column as it seemed unnecessary.
Also: For this to work vertically the GridSplitter's
HorizontalAlignment
must be set toStretch
, otherwise it will have zero width by default (of course everything else that is orientation-specific must be adapted as well but that is straightforward)Maybe this will help to solve your "column collapse" problem
XAML:
Add in
<Grid>
Name="expGrid"
and add in<Expander>
Collapsed="Expander_Collapsed"
C# Code: