是否可以在流文档中垂直对齐listitem标记?

时间:2010-03-26 08:33:27

标签: wpf flowdocument

我想将listitem标记对齐到顶部,默认是对齐到第一个底部 块。

我的错误的代码:

<Grid>
    <FlowDocumentScrollViewer>
        <FlowDocument>
            <List MarkerStyle="Decimal">
                <ListItem>
                    <BlockUIContainer>
                        <Grid>
                            <Rectangle Height="100" Fill="HotPink" />
                            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Picture</TextBlock>
                        </Grid>
                    </BlockUIContainer>
                    <Paragraph>TextTextTextTextTextTextText</Paragraph>
                </ListItem>
            </List>
        </FlowDocument>
    </FlowDocumentScrollViewer>
</Grid>

1 个答案:

答案 0 :(得分:0)

<FlowDocumentScrollViewer>
    <FlowDocument>
        <List MarkerStyle="Decimal">
            <ListItem>
                <BlockUIContainer/>     
                    <BlockUIContainer>
                        <Grid Margin="0,-10,0,0">
                            <Rectangle Height="100" Fill="HotPink" />
                            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Picture</TextBlock>
                        </Grid>
                    </BlockUIContainer>
                    <Paragraph>TextTextTextTextTextTextText</Paragraph>
             </ListItem>
        </List>
    </FlowDocument>
</FlowDocumentScrollViewer>