“讲述人”中的阅读顺序错误
我的 Microsoft 讲述人遇到问题。
我有一个像这样的 WPF 片段:
<Window
x:Class="InlineEditbox.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Narrator test" SizeToContent="WidthAndHeight">
<TextBlock>
<Run xml:space="preserve">I want to pay </Run>
<InlineUIContainer>
<TextBox Width="70" HorizontalContentAlignment="Right">0</TextBox>
</InlineUIContainer>
<Run xml:space="preserve"> % more</Run>
</TextBlock>
</Window>
文本显示正确;然而旁白这样读:“我想多付百分之零,”而不是预期的“我想多付百分之零”。
我做错了什么吗?叙述者可以因此阅读全文。有没有一种方法可以解决该问题而不需要更改实际文本?
I've got a problem with Microsoft Narrator.
I've got a WPF fragment like this:
<Window
x:Class="InlineEditbox.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Narrator test" SizeToContent="WidthAndHeight">
<TextBlock>
<Run xml:space="preserve">I want to pay </Run>
<InlineUIContainer>
<TextBox Width="70" HorizontalContentAlignment="Right">0</TextBox>
</InlineUIContainer>
<Run xml:space="preserve"> % more</Run>
</TextBlock>
</Window>
The text is displayed correctly; however the Narrator reads it this way: "I want to pay percent more, zero" instead of the expected "I want to pay 0 percent more".
Am I doing something wrong? The Narrator could have read the whole text just consequently. Is there a way to work around the problem without the need to change the actual text?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WPF 团队成员的回答:
WPF 支持可以将子控件与其文本混合的文本控件。 UI 自动化树则不然。无法向自动化客户端描述子编辑控件位于父文本中的位置。 WPF 无法轻松解决此问题 - 这是自动化架构的限制。
要解决此问题,可以将文本放入单独的控件中,以一种可转化为自动化的方式描述顺序:
Thx,Rob Relyea
WPF 团队
Answer from WPF team member:
WPF supports a text control that can have child controls intermixed with its text. The UI Automation tree does not. There is no way describe to automation clients where the child edit control lives within the parent's text. WPF cannot easily fix this - it's a limitation of the automation architecture.
To workaround, one can put the text into separate controls to describe the order in a way that translates to automation:
Thx, Rob Relyea
WPF Team
不要使用旁白,这是一个非常基本的屏幕阅读程序,日常需要使用屏幕阅读器的人通常不会使用它。有关屏幕阅读器的使用建议,请参阅以下问题。 哪个屏幕阅读器会最好测试网站的可访问性以及如何配置它?
Don't use narrator, it's an extremely basic screen reading program and is not generally used by people who need to use a screen reader on a daily basis. See the following question for reccomendations on screen readers to use. Which screen reader would be best to test site accessibility and how to configure that?