FlowDirection.RightToLeft 弄乱了字符串

发布于 2024-12-12 21:58:52 字数 357 浏览 3 评论 0原文

切换到 RightToLeft(通过更改 MainWindow.FlowDirection)会更改末尾有圆括号(右括号)的字符串,方法是将其作为左括号放在开头。

我缺少什么吗?这是一个错误吗?这是正常的吗?

这是启用 RTL 后的样子:

strings messed up

.. 这就是方式禁用 RTL 后的情况如下:

在此处输入图像描述

请注意括号如何变化?

Switching to RightToLeft (by altering MainWindow.FlowDirection) changes strings which have a round (closing) paranthesis at the end by placing it as an opening paranthesis at the start.

Is something that I'm missing? Is this a bug? Is it normal?

This is how things look with RTL enabled:

strings messed up

.. and this is how things look with RTL disabled:

enter image description here

Notice how the paranthesis change?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深府石板幽径 2024-12-19 21:58:52

不幸的是,这是一个已知的 WPF 错误。
解决方法是在字符串后面添加一个不可见字符:

<TextBlock FlowDirection="RightToLeft">                    
    <Run>Label1 (cms)</Run>
    <Run FontSize=".01">i</Run>
</TextBlock> 

或者使用

HorizontalContentAlignment="Right" 

Replace of

FlowDirection="RightToLeft"

Unfortunately this is a known WPF bug.
The workaround is to have an invisible character after the string:

<TextBlock FlowDirection="RightToLeft">                    
    <Run>Label1 (cms)</Run>
    <Run FontSize=".01">i</Run>
</TextBlock> 

Or use

HorizontalContentAlignment="Right" 

Instead of

FlowDirection="RightToLeft"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文