← ClaudeAtlas

implementing-wpf-automationlisted

Implements WPF UI Automation for accessibility using AutomationPeer and AutomationProperties. Use when building accessible applications or enabling screen reader support.
christian289/dotnet-with-claudecode · ★ 41 · AI & Automation · score 73
Install: claude install-skill christian289/dotnet-with-claudecode
# WPF UI Automation Patterns Implementing accessibility features using UI Automation framework. ## Prerequisites When implementing AutomationPeer for a CustomControl, ensure the control project is properly set up: - **ThemeInfo attribute** in AssemblyInfo.cs → See `/configuring-wpf-themeinfo` - **CustomControl project structure** → See `/authoring-wpf-controls` - **DefaultStyleKeyProperty** in static constructor --- ## 1. UI Automation Overview ``` UI Automation Framework ├── Providers (Server-side) │ ├── AutomationPeer (base class) │ ├── FrameworkElementAutomationPeer │ └── Custom AutomationPeers ├── Clients (Consumer-side) │ ├── Screen readers (Narrator, JAWS) │ ├── Testing tools │ └── Custom automation clients └── Automation Properties ├── AutomationProperties.Name ├── AutomationProperties.HelpText └── AutomationProperties.LabeledBy ``` --- ## 2. AutomationProperties ### 2.1 Basic Properties ```xml <!-- Name - primary identifier for screen readers --> <Button Content="Submit" AutomationProperties.Name="Submit form"/> <!-- Name for image buttons (no text content) --> <Button AutomationProperties.Name="Close window"> <Image Source="/Icons/close.png"/> </Button> <!-- HelpText - additional description --> <TextBox AutomationProperties.Name="Email address" AutomationProperties.HelpText="Enter your email in format user@domain.com"/> <!-- LabeledBy - reference to label element --> <Label x:Name="UsernameLabel" Content="Us