如何垂直对齐 FlowDocument 的 TableCell(或其内容)

How can I vertically align a TableCell (or its content) of a FlowDocument

有什么方法可以让TableCell的内容对齐到底部吗?我以为这很容易,但显然不是。

情况:

FlowDocument 我有以下(简化)Table:

<Table>
    <Table.Columns>
        <TableColumn Width="Auto"/>
        <TableColumn Width="Auto"/>
        <TableColumn Width="Auto"/>
    </Table.Columns>
    <TableRowGroup>
        <TableRow>
            <TableCell>
                <BlockUIContainer>
                    <Image Source="{Binding to an image}"/>
                </BlockUIContainer>
            </TableCell>
            <TableCell containing something else/>
           <TableCell>
                <BlockUIContainer>
                    <Image Source="{Binding to another image}"/>
                </BlockUIContainer>
            </TableCell>
        </TableRow>
    </TableRowGroup>
</Table>

两张图片的高度不同,所以在较小的一张下面有一些空的space。

我想要的:

相反,我想要space上面较小的图像(即与TableRow底部对齐的图像)。

我试过的:

我试图找到一个 VerticalAlignment 属性 来改变对齐方式。但是,BlockUIContainerTableCellTableRow中没有VerticalAlignment属性。

此外,我尝试用 InlineUIContainer 替换 BlockUIContainer 并设置它的 BaselineAlignment。但是,要做到这一点,我必须像这样将它包装成 Paragraph

<TableCell>
    <Paragraph>
        <InlineUIContainer BaselineAlignment="Bottom">
            <Image Source="{Binding to an image}"/>
        </InlineUIContainer>
    </Paragraph>
</TableCell>

现在我有一个图像与 Paragraph 的底部对齐,它与 TableCell 的顶部对齐,并且仅与 Image 所需的一样高。所以它看起来和以前一模一样。

根据我的经验,唯一的方法是使用网格来格式化整个 table 行。使用网格创建列,而不是 table。因此,您可以使用网格的功能来底部对齐图像。这是您的 table 现在的样子...

    <Table>
        <TableRowGroup>
            <TableRow>
                <TableCell>
                    <BlockUIContainer>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Source="Images/globe.png" Height="10" Width="10" VerticalAlignment="Bottom"/>
                            <TextBlock Grid.Column="1" TextWrapping="Wrap">This is something else</TextBlock>
                            <Image Grid.Column="2" Source="Images/globe.png" Height="20" Width="20" VerticalAlignment="Bottom"/>
                        </Grid>
                    </BlockUIContainer>
                </TableCell>
            </TableRow>
        </TableRowGroup>
    </Table>