Improving Screen Reading

If you turn on Narrator and launch the HelloRealWorld app (with English as the Windows default language), you hear the following:

“HelloRealWorld window”

Editing

The first utterance is triggered by the app’s window getting focus, and the second utterance is triggered by the TextBox getting focus (which happens automatically).

This experience isn’t good enough, because Narrator doesn’t report the purpose of the TextBox. To fix this, we need to leverage the UI Automation framework, which is as simple as setting the following automation property on the TextBox:

<TextBox AutomationProperties.Name ="Please enter your name"          Name="nameBox" Margin="12"/>

If you add this property then ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.