Narrator announce status changes

Status changes announced in WPF

Announce status

In this blog post, I want to discuss how to make status changes on the screen accessible to users with a screen reader. In this case, the user started a process and as time passed, the process when through a number of states. When the state changes the narrator should announce that to the user.

The first solution I found is setting the AutomationProperties.ItemStatus. Unfortunately, the element that had focus was removed from the screen in processing steps. In my next blog post, I describe how to announce a status change where you have the focus on the element that changes. More on using the ItemStatus can be found here: narrator-announcing-an-items-status

A second-way of announcing changes on the screen can be achieved with Live Regions. The LiveRegionChanged event is introduced with .Net Framework 4.7.1 (.Net Framework 4.7.1 accessibility and WPF improvements). Live Regions enables a screen reader to announce important changes to the user that are not on currently focused elements.

The AutomationProperties.LiveSetting indicates how aggressive the messages should be read when the LiveRegionChanged is triggered. LiveRegionChanged can have 3 values:
– None
– Polite
– Aggressive
The following code shows the Textbox and how to trigger the event:

<TextBlock Name="MyTextBlock" AutomationProperties.LiveSetting="Assertive">announcement</TextBlock>

The code to trigger the status change:

var peer = FrameworkElementAutomationPeer.FromElement(MyTextBlock);

When you have triggered the LiveRegionChanged event, the announcement will be given.

Final thoughts
Making announcements of status changes in WPF is quite easy using the LiveRegionChanged event. Hopefully, this will help some users to get more out of the UI.

Image by: Jeremy Yap

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: