问题
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