如何使用 GridSplitter 调整右外网格列的大小

How to resize right outer Grid column with GridSplitter

我的应用程序中有以下网格结构:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0"
          Visibility="{Binding LeftColumnVisibility, Converter={StaticResource BooleanToVisibilityConverter}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250"/>
            <ColumnDefinition Width="3"/>
        </Grid.ColumnDefinitions>
        <DockPanel Grid.Column="0">
            <!-- Stuff -->
        </DockPanel>
        <GridSplitter Grid.Column="1" 
                      HorizontalAlignment="Stretch" 
                      ResizeBehavior="PreviousAndCurrent" 
                      ResizeDirection="Columns"/>
    </Grid>
    <DockPanel Grid.Column="1">
        <!-- More Stuff -->
    </DockPanel>
    <Grid Grid.Column="2" 
          Visibility="{Binding RightColumnVisibility, Converter={StaticResource BooleanToVisibilityConverter}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3"/>
            <ColumnDefinition Width="250"/>
        </Grid.ColumnDefinitions>
        <GridSplitter Grid.Column="0" 
                      HorizontalAlignment="Stretch"
                      ResizeBehavior="CurrentAndNext" 
                      ResizeDirection="Columns" />
        <StackPanel Grid.Column="1">
            <!-- So Much Stuff -->
        </StackPanel>
    </Grid>
</Grid>

左列的大小调整符合预期。
我可以调整左列的大小,hiding/showing 它保持所需的大小。

当我尝试调整右侧列的大小时:

我已经坐了很长时间了,尝试了我可能想到的 属性 设置和网格嵌套的所有组合。

我希望在调整网格列大小时保持中间列 (Width="*") 不变。只有右列的大小应该改变,以便中间列仍然用完所有剩余的 space.

如何让我的 GridSplitter 正确调整大小?

非常感谢。

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Border Grid.Column="0" Background="LightPink"/>
        <GridSplitter Grid.Column="1" 
                        Width="3"
                        ResizeBehavior="PreviousAndCurrent" 
                        ResizeDirection="Columns"/>
    </Grid>
    <Border Grid.Column="1" Background="LightGreen"/>
    <Grid Grid.Column="2">
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="250"/>
        </Grid.ColumnDefinitions>
        <GridSplitter Grid.Column="0" 
                        Width="3"
                        ResizeBehavior="CurrentAndNext" 
                        ResizeDirection="Columns"/>
        <Border Grid.Column="1" Background="LightCyan"/>
    </Grid>
</Grid>