In my WPF app, I have four separate quadrants, each with it's own grid and data. The four grids are separated by GridSplitters. The GridSplitters allow the user to resize each box by selecting either a horizontal or vertical splitter.
I am trying to allow the user to resize the grids by selecting the center point (circled in red).

I expected to have a four-way mouse pointer that could be used to drag up, down, left, and right. But, I only have the option to move windows up and down... or left and right.
What I've tried:
<Grid> <!-- Main Grid that holds A, B, C, and D -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="5"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid x:Name="gridA" Grid.Column="0" Grid.Row="0"/>
<GridSplitter Grid.Column="0" Grid.Row="1" Height="5" HorizontalAlignment="Stretch"/>
<Grid x:Name="gridC" Grid.Column="2" Grid.Row="0"/>
<GridSplitter Grid.Column="3" Grid.Row="1" Height="5" HorizontalAlignment="Stretch"/>
<Grid x:Name="gridB" Grid.Column="0" Grid.Row="2"/>
<GridSplitter Grid.Column="1" Grid.Row="0" Width="5" HorizontalAlignment="Stretch"/>
<Grid x:Name="gridD" Grid.Column="2" Grid.Row="2"/>
<GridSplitter Grid.Column="1" Grid.Row="2" Width="5" HorizontalAlignment="Stretch"/>
</Grid>


Let me begin by changing your XAML a little bit, since right now we have four distinct
GridSplitters, but two is enough:What is more important about this markup is that we now have an intersection point between two splitters:
In order to drag two splitters at a time, we need to know when should we. For that purpose, let's define a
Booleanflag:We need to update the flag whenever the user clicks on either of the splitters (note that
Previewevents are used -GridSplitterimplementation marksMouseevents asHandled):The
UpdateMouseStatusOnSplittersis the core method here. WPF does not provide multiple layer hit testing "out of the box", so we'll have to do a custom one:Now we can implement the concurrent dragging. This will be done via a handler for
DragDelta. However, there are a few caveats:HorizontalSplitter)Changevalue inDragDeltaEventArgsis bugged, the_lastHorizontalSplitterHorizontalDragChangeis a workaroundColumn/RowDefinitions. In order to avoid weird clipping behavior (the splitter dragging the column/row with it), we'll have to use the size of it in pixels as the the size of it in starsSo, with that out of the way, here's the relevant handler:
Now, this is almost a full solution. It, however, suffers from the fact that even if you move your mouse horizontally outside of the grid, the
VerticalSplitterstill moves with it, which is inconsistent with the default behavior. In order to counteract this, let's add this check to the handler's code:Finally, we need to reset our
_lastHorizontalSplitterHorizontalDragChangeto zero when the dragging is over:I hope it is not too daring of me to leave the implementation of the cursor's image change to you.