I want to make a custom GridSplitter that combines a regular splitter behaviour plus a feature – when the splitter resizes automatically one of the areas to zero.
So normal usage is:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" Name="A"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="0.5*" Name="B"/>
</Grid.ColumnDefinitions>
<GridSplitter Grid.Column="1"... />
initially – both columns A and B have same size = 50% of available width.
User can drag the splitter to change their widths.
Now I want user to be able to double click on the splitter (or any other way to initiate the action) – and the column A resized to 0 and B to 100%, if acted again – then A to 100% and B to 0.
Obviously I can do it in the parent by setting column widths in code behind. But I want to reuse this functionality in other parts and make it as simple to use as possible.