【发布时间】:2019-01-27 23:13:33
【问题描述】:
我有一个带有 AutomationProperties.LiveSettings="Assertive" 的文本块 (ContentTextBlock)。我只是在测试和检查此功能的有用性。而且......到目前为止我很失望。
private void Button_Click(object sender, RoutedEventArgs e)
{
ContentTextBlock.Text += " test";
var peer = UIElementAutomationPeer.FromElement(ContentTextBlock);
if(peer == null)
{
peer = UIElementAutomationPeer.CreatePeerForElement(ContentTextBlock);
peer.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
}
peer.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
}
使用“讲述人”时,它会像宣传的那样工作。每当单击按钮时,讲述人都会宣布 TextBlock 文本(“测试”“测试测试”“测试测试测试”)......但是当我使用 NVDA 或 JAWS 时,没有任何反应,尽管屏幕阅读器版本相对最新。他们真的没有添加任何对 live-regions 的支持,还是我错过了一个重要的点?
【问题讨论】:
标签: c# wpf accessibility screen-readers