RichTextBlock
spacing between title and second paragraph
#9168
-
DescriptionI wrote a simple RichTextBlock code: <RichTextBlock TextIndent="20">
<Paragraph FontSize="28">
<Bold>Is this the right control?</Bold>
<LineBreak FontSize="14"/>
</Paragraph>
<Paragraph>
<Run>Use a</Run>
<Bold>RichTextBlock</Bold>
<Run>
when you need support for multiple paragraphs, multi-column or other complex text layouts, or inline UI elements like images.
</Run>
<LineBreak/>
</Paragraph>
<Paragraph>
<Run>Use a</Run>
<Bold>TextBlock</Bold>
<Run>
to display most read-only text in your app. You can use it to display single-line or multi-line text, inline hyperlinks, and text with formatting like bold, italic, or underlined. TextBlock provides a simpler content model, so it's typically easier to use, and it can provide better text rendering performance than RichTextBlock. It's preferred for most app UI text. Although you can put line breaks in the text, TextBlock is designed to display a single paragraph and doesn't support text indentation.
</Run>
<LineBreak/>
</Paragraph>
<Paragraph>
<Run>For more info about choosing the right text control, see the</Run>
<Hyperlink Foreground="OrangeRed" NavigateUri="https://learn.microsoft.com/en-us/windows/apps/design/controls/text-controls">
Text controls
</Hyperlink>
<Run>article.</Run>
</Paragraph>
</RichTextBlock> Current behaviorThe current behavior is that after the title I have a huge spacing between title and second paragraph: And that is quite interesting because I don't have any features for this case. Expected behaviorI'am expecting that the spacing between first and second line should be the same as in second and third line. |
Beta Was this translation helpful? Give feedback.
Answered by
kmgallahan
Dec 17, 2023
Replies: 1 comment 4 replies
-
Have you tried moving your first LineBreak to the start of the 2nd paragraph? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then try:
because: