有谁知道如何使UIElement的宽度自动但不自动调整到其父级?我想让它扩展到容器之外(即使它被切断了 . )

现在它这样做:
enter image description here

我希望它能做到这一点:
enter image description here

如果我在xaml中定义宽度,我可以实现这一点,但我想用auto做 .

XAML:

<UserControl.Resources>
    <DataTemplate x:Key="ItemTemplate">
        <StackPanel>
            <TextBlock Text="{Binding RandomValues}"/>
        </StackPanel>
    </DataTemplate>
    <ItemsPanelTemplate x:Key="UniformGridPanel">
        <UniformGrid Rows="1" HorizontalAlignment="Center"/>
    </ItemsPanelTemplate>
</UserControl.Resources>

<ListBox HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="Auto" DataContext="{Binding}" ItemTemplate="{DynamicResource ItemTemplate}" ItemsSource="{Binding Collection}" ItemsPanel="{DynamicResource UniformGridPanel}" Style="{DynamicResource ListBoxStyle}"/>