---
title: "Implementing an accessible, checkable WPF Tree View"
description: "Checkboxes nested inside WPF TreeViewItems don't report checked state to screen readers, because TreeViewItem doesn't support the UI Automation toggle control pattern."
url: "https://swe.quest/articles/implementing-an-accessible-checkable-wpf-tree-view-e059f959873d2e23"
canonical: "https://devblogs.microsoft.com/engineering-at-microsoft/implementing-an-accessible-checkable-wpf-tree-view/"
source: "Engineering@Microsoft"
published: "2023-03-15"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["accessibility","dotnet","frontend"]
---

# Implementing an accessible, checkable WPF Tree View

A post on [Engineering@Microsoft](https://swe.quest/sources/ms-engineering.md), published 2023-03-15, 4 min read, How-to. Original: [https://devblogs.microsoft.com/engineering-at-microsoft/implementing-an-accessible-checkable-wpf-tree-view/](https://devblogs.microsoft.com/engineering-at-microsoft/implementing-an-accessible-checkable-wpf-tree-view/)

## Summary

Checkboxes nested inside WPF TreeViewItems don't report checked state to screen readers, because TreeViewItem doesn't support the UI Automation toggle control pattern. Stuffing "checked"/"unchecked" into the control name is a poor workaround: it bypasses screen reader customization and never announces state changes. The fix in Accessibility Insights for Windows uses a chain of custom subclasses: CheckableTreeView, CheckableTreeViewItem, and two custom automation peers. The final peer implements IToggleProvider by wiring the view model's existing IsChecked property to ToggleState and Toggle.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Accessibility](https://swe.quest/tags/accessibility.md) (Web & mobile)
- [.NET](https://swe.quest/tags/dotnet.md) (Languages)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- WPF and XAML
- UI Automation basics

## Keywords

WPF, UI Automation, IToggleProvider, Accessibility Insights for Windows, TreeViewItem, AutomationPeer

## Related posts

- [Accessibility Insights for Windows](https://swe.quest/articles/accessibility-insights-for-windows-b9d389a54b09a2fc.md): Engineering@Microsoft · 2021-12-13 · Medium · 5 min read · Accessibility, Developer tools, .NET, Testing
  Accessibility Insights for Windows is an open-source .NET/WPF tool built on Microsoft's UI Automation framework for finding and fixing accessibility issues in Windows apps.
- [Considerations for making a tree view component accessible](https://swe.quest/articles/considerations-for-making-a-tree-view-component-accessible-d55d10f05de5e995.md): GitHub Engineering · 2025-01-28 · Medium · 10 min read · Accessibility, Frontend, Design systems
  GitHub's accessible file tree models Windows File Explorer's tree view behavior, since that is what many desktop screen reader users already know.
- [Accessibility considerations behind code search and code view](https://swe.quest/articles/accessibility-considerations-behind-code-search-and-code-view-4501ed426b29574e.md): GitHub Engineering · 2023-07-06 · Medium · 10 min read · Accessibility, Frontend, Browsers, Design systems
  GitHub rebuilt code search and code view to remove accessibility barriers that pushed screen reader users toward raw files.
- [An HTML Switch Control](https://swe.quest/articles/an-html-switch-control-f6ff0673a2bcdfca.md): WebKit · 2024-02-28 · Medium · 3 min read · Browsers, Frontend, Accessibility, CSS
  Safari 17.4 adds a native HTML switch control via \`\<input type=checkbox switch\>\`, which falls back to a plain checkbox in browsers without support.
- [Automated Accessibility Testing at Slack](https://swe.quest/articles/automated-accessibility-testing-at-slack-ada6bed3cb3ffab2.md): Slack Engineering · 2025-01-07 · Medium · 12 min read · Accessibility, Testing, Frontend, CI/CD
  Slack added automated accessibility checks to its desktop end-to-end tests by integrating Axe into Playwright via @axe-core/playwright, after embedding checks in Jest/React Testing Library proved impractical with its custom Jest setup.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
