如何在 XAML 中换行或换行 [英] How to Line Break or new line in XAML

查看:115
本文介绍了如何在 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&#10;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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆