Gridsplitter does not allow user to resize grid

531 views Asked by At

My code is as follows:

<Grid 
    ShowGridLines="True">
    <Grid.RowDefinitions>
        <RowDefinition Height="*"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="150"></ColumnDefinition>
        <ColumnDefinition Width="5"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <GridSplitter 
        Grid.Row="0" 
        Grid.Column="1" 
        Grid.ColumnSpan="2"
        Width="5" 
        Background="Purple"  
        HorizontalAlignment="left" />

    <ListBox 
        Grid.Row="0"
        Grid.Column="0"
        ItemsSource="{Binding Tests}"
        ScrollViewer.HorizontalScrollBarVisibility="Visible" 
        Grid.IsSharedSizeScope="True">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="10*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <TextBlock 
                        Text="{Binding Name}"
                        Grid.Column="0">
                    </TextBlock>

                    <Image
                        Grid.Column="1">
                    </Image>
                </Grid>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>

    <TextBlock 
        Grid.Row="0"
        Grid.Column="1"
        Text="{Binding CommandPromptOutput}">
    </TextBlock>

    <Button 
        Grid.Row="1"
        Grid.Column="2" 
        Content="Run" VerticalAlignment="Bottom" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch" />
</Grid>

The grid splitter is showing up but it has no control over resizing anything.

I have also tried adding:

<GridSplitter 
        Grid.Row="0" 
        Grid.Column="1" 
        Grid.ColumnSpan="2"
        Width="5" 
        Background="Purple"  
        HorizontalAlignment="left" 

        ResizeDirection="Columns" 
        ResizeBehavior="PreviousAndNext" />

enter image description here

0

There are 0 answers