开发者

Wrong reading order in Narrator

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&g开发者_运维百科t;
</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?


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:

<TextBlock>I want to pay</TextBlock>
<TextBox> 0 </TextBox>
<TextBlock>% more</TextBlock>

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜