Ошибка WPF? Столбец сетки не вмещает полосу прокрутки ListBox

В следующем примере ширина самого левого столбца не увеличивается, чтобы вместить полосу прокрутки ListBox, которая появляется при уменьшении высоты UserControl:

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Example">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Grid.ColumnSpan="2">Example text</TextBlock>
        <ListBox Grid.Row="1" Grid.Column="0">
            <ListBoxItem>One</ListBoxItem>
            <ListBoxItem>Two</ListBoxItem>
            <ListBoxItem>Three</ListBoxItem>
            <ListBoxItem>Four</ListBoxItem>
            <ListBoxItem>Five</ListBoxItem>
        </ListBox>
        <Expander Grid.Row="1" Grid.Column="1" Header="Expander" />
    </Grid>
</UserControl>

Когда TextBlock с атрибутом ColumnSpan удаляется, размер столбца изменяется, как и ожидалось. Это ошибка в WPF?


person M. Dudley    schedule 21.08.2009    source источник
comment
Я могу воссоздать это поведение в Kaxaml, и, кажется, не имеет значения, в каком порядке вы объявляете вещи. Возможно, вы могли бы сообщить об ошибке на connect.microsoft.com?   -  person user7116    schedule 21.08.2009


Ответы (1)