如何在 XAML 中换行或换行 [英] How to Line Break or new line in XAML
问题描述
我很难匹配 XAML 中设置的特殊字符.我只对以下内容:
I am having hard time to match Special characters set in XAML. I only on the following:
在 XAML 超链接按钮中表示 LineBreak:
To represent a LineBreak in XAML hyperlink button:
使用:> lineBreak <
use : > lineBreak <
但是我用什么来表示 XAML 超链接按钮中的换行符或换行符?
But What do I use to represent a New Line or LineBreak In XAML hyperlink button??
例如:我想要这一行 mag:这是第一行.这是第二行
Example : I want this one line mag : This is line one. This is line two
进入这个:
这是第一行.这是第二行.
This is line one. This is line two.
看来这 不起作用.这是第一行
it seems this is not working. This is line one
推荐答案
您有多种选择.例如;
<HyperlinkButton Content="Line One Line Two"/>
或
<HyperlinkButton>
<HyperlinkButton.Content>
<TextBlock>
<Run Text="Line 1"/><LineBreak/><Run Text="Line 2"/>
</TextBlock>
</HyperlinkButton.Content>
</HyperlinkButton>
希望这会有所帮助.
附录:你基本上可以在任何事情上做这些事情.WPF、Silverlight、UWP 等等.这不是特定于 WP 的.
Addendum: You can do this stuff in basically anything. WPF, Silverlight, UWP, whatever. It's not WP specific.
这篇关于如何在 XAML 中换行或换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!