哪个控件适用于在 WPF 中创建动态网格

Which Control is sutiable for creating a Dynamic Grid in WPF

您好,我正在使用 POS(销售点)系统,因为我必须在下面提到的图片中显示订单

我试过使用 Wrap 面板,但它会生成类似

的网格

看到它会占用所有网格的最大高度,我想实现与 image1 完全相同的任何人都可以帮助哪个 WPF 控件适合实现它。

对我来说,顶部图片看起来像一个垂直方向的包装面板。

MainWindow.xaml

<Window x:Class="WpfApplication24.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Background="Black"
    Title="MainWindow" Height="350" Width="525">
<Window.Resources>
    <Style TargetType="TextBlock">
        <Setter Property="Margin" Value="5" />
        <Setter Property="Foreground" Value="Black" />
    </Style>
    <Style TargetType="StackPanel">
        <Setter Property="Width" Value="100" />
        <Setter Property="Margin" Value="5" />
        <Setter Property="Background" Value="Red" />
    </Style>
</Window.Resources>
<WrapPanel Orientation="Vertical">
    <StackPanel>
        <TextBlock Text="A Line" />
    </StackPanel>
    <StackPanel>
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
    </StackPanel>
    <StackPanel>
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
    </StackPanel>
    <StackPanel>
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
    </StackPanel>
    <StackPanel>
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
    </StackPanel>
    <StackPanel>
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
    </StackPanel>
    <StackPanel>
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
    </StackPanel>
    <StackPanel>
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
        <TextBlock Text="A Line" />
    </StackPanel>
</WrapPanel>