Background: in a Grid, I have two panels with GridSplitterfor resizing them, and a button to switch the collapse or uncollapse of the left panel.
The behavior is correct when uncollapsed.
When collapsed, if I use the GridSplitter, the left panel remains at 0 pixels, but I want it to follow the resize done by the GridSplitter.
How to achieve this? It seems that I could use of the the events of the GridSplitter, but which one, and how? Drag* Mouse*?
I have a user control:
<UserControl x:Class="SublimeTriptych.control.Repro"
xmlns=";
xmlns:x=";
xmlns:mc=";
xmlns:d=";
xmlns:local="clr-namespace:SublimeTriptych.control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Name="ContainerGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="160"/>
<ColumnDefinition Width="4"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="1" Background="Gold"
Visibility="{Binding PanelVisibility, Mode=OneWay, RelativeSource={RelativeSource AncestorType=local:Repro}}"/>
<GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
<Border Grid.Column="2" Background="Orange"/>
<DockPanel Grid.ColumnSpan="3" Grid.Column="0" VerticalAlignment="Bottom">
<Button HorizontalAlignment="Center" Command="{Binding SwitchVisibilityCommand, RelativeSource={RelativeSource AncestorType=local:Repro}}">