3

我正在开发我的第一个 Windows 8 应用程序 (C#/XAML),我想在段落的开头包含首字下沉。有人知道怎么做吗?

4

1 回答 1

1

您可以在 a中组合RichTextBlock和:RichTextBlockOverflowGrid

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
    </Grid.RowDefinitions>
    <RichTextBlock FontSize="48" FontFamily="Cambria" Margin="12" OverflowContentTarget="{Binding ElementName=o2}">
            <Paragraph FontSize="122">L</Paragraph>
            <Paragraph>orem ipsum dolor sit amet, consectetur adipisicing elit. Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. 
                Phasellus pharetra nulla ac diam. Quisque semper justo at risus. Donec venenatis, turpis vel hendrerit
                interdum, dui ligula ultricies purus, sed posuere libero dui id orci. Nam congue, pede vitae dapibus 
                aliquet, elit magna vulputate arcu, vel tempus metus leo non est. Etiam sit amet lectus quis est 
                congue mollis. Phasellus congue lacus eget neque. Phasellus ornare, ante vitae consectetuer consequat,
                purus sapien ultricies dolor, et mollis pede metus eget nisi. Praesent sodales velit quis augue. 
                Cras suscipit, urna at aliquam rhoncus, urna quam viverra nisi, in interdum massa nibh nec erat.</Paragraph>
    </RichTextBlock>
    <RichTextBlockOverflow Name="o2" Grid.Column="1" Grid.ColumnSpan="3"  Margin="12" OverflowContentTarget="{Binding ElementName=o3}" />
    <RichTextBlockOverflow Name="o3" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" />
</Grid>

看起来:

在此处输入图像描述

于 2013-10-08T06:32:54.073 回答