Silverlight: How do I get a screen reader to read something?

Silverlight does a great job of making the automation tree available, but is there a way to programmatically ask the screen reader to read something? So far I have used:

AutomationPeer peer = FrameworkElementAutomationPeer.FromElement(element); if (peer == null) { peer = FrameworkElementAutomationPeer.CreatePeerForElement(element); } if (peer != null) { peer.RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged); } 

This works fine in the Silverlight debugging environment (i.e. if I run IE from inside VS), but does not work if I run IE outside of Visual Studio (even if it points to the same internal development server ...). So is there another easy way to ask the screen reader to read something?

EDIT: It also works great in MS storyteller, but not in NVDA ... weird.

+4
source share
1 answer

I think you need to focus on the element itself. Screen readers track focus, then read values โ€‹โ€‹based on focus. If you fire the AutomationFocusChanged event, it can detect this, but return to the same control as before.

0
source

All Articles