Narrator. Scan mode. For TextBlock the narrator reads the Text properties twice

五迷三道 提交于 2020-01-15 10:42:40

问题


I have a TextBlock with dynamic data (Timer). The Text property is updated once per second.

The narrator sometimes (not always) reads the text twice in scan mode, because it have two properties with text: Text and AutomationProperty.Name. I tried to write data directly to the text block TextBlock.Text = Text; (not a binding) and to change different parameters AutomatonProperties, it didn't help.

XAML:

<TextBlock Text="{x:Bind Text, Mode=OneWay}"/>

C#:

private string _text;
public string Text
{
    get { return _text; }
    set
    {
        _text = value;
        OnPropertyChanged("Text");
    }
}

How correctly to adjust the TextBlock that the Narrator in a Scan Mode read it once?


回答1:


Do you know when narrator is reading your TextBlock?

Maybe you can stop text update while narrator is reading text and continue when narrator will stop reading. That can fix the problem.

Do you know when narrator starts reading your TextBlock?

You can stop text update for a 2 seconds for example. That also can fix the problem.

Is TextBlock recreation every second do a lot of impact?

You can create a new textblock every second. Maybe that can properly change the behavior of narrator.



来源:https://stackoverflow.com/questions/45753140/narrator-scan-mode-for-textblock-the-narrator-reads-the-text-properties-twice

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!