Stop Screen Reader to read my control type in WPF

567 Views Asked by At

I have an old WPF application with needs and accessibility features. The application uses radio buttons to construct a menu with a popup.

The problem is the user doesn't want the narrator to say "radio button" when it's clicked. I am using AutomationProperties.HelpText and AutomationProperties.Name to adjust the text for the controls. I have no idea how to change the "ControlType" the narrator reads out when the control is in focus.

        <RadioButton
            AutomationProperties.AcceleratorKey="1"
            AutomationProperties.AccessKey="3"
            AutomationProperties.AutomationId="2"
            AutomationProperties.HelpText="Taufiq"
            AutomationProperties.ItemStatus="Test"
            AutomationProperties.ItemType="Text"
            AutomationProperties.Name="Take Snapshot"
            Command="{Binding TakeSnapshotCommand}">
            <StackPanel Orientation="Horizontal">
                <ContentControl Content="{DynamicResource GalleryIcon}" Focusable="False" />
                <TextBlock Text="Take Snapshot" />
            </StackPanel>
        </RadioButton>

None of the properties of the AutomationProperties works.

1

There are 1 best solutions below

0
Drew Noakes On

My understanding is that narrator will read the advertised type so that someone relying on the screen reader knows how to interact with the focussed item.

If you really need to control how this works, you'll need to subclass RadioButton and override OnCreateAutomationPeer to create your own peer which can then gain quite a bit of control.