Is it possible to vertically align the listitem marker in a streaming document?

I want to align the listitem marker to the top, by default, align to the bottom of the first block.

My error code is:

<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>
+3
source share
1 answer
<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>
0
source

Source: https://habr.com/ru/post/1738627/


All Articles