# WPF Accessibility, Scaling, and Theming Apply these rules when building or changing WPF views, controls, styles, or themes. Load the UI/UX rules for general interface design; Windows conventions, not macOS ones, decide navigation, menus, and settings. ## Accessibility * Give every interactive element without visible text an accessible name with `AutomationProperties.Name`, and add `AutomationProperties.HelpText` where the purpose is not obvious. Keep names in sync with the visible label or state. * Make every action reachable by keyboard: logical tab order, `AccessText` or access keys for important commands, and `IsDefault` and `IsCancel` on dialog buttons. Use `KeyboardNavigation` settings deliberately inside lists, toolbars, and custom containers. * Keep focus visible. Do not remove `FocusVisualStyle` without an equal replacement, and move focus deliberately when dialogs open and close. * Support high contrast: use `SystemColors` and theme resources instead of hard-coded brushes, and never convey state by color alone. * Give custom controls an `AutomationPeer` that exposes their role, name, and state, and check them with Narrator and an accessibility inspector. ## Scaling * Lay out in device-independent units with `Auto` and star sizing; never assume 96 DPI or a fixed screen size. * Use vector icons or multi-resolution image assets so the UI stays sharp at every scale factor, and test at 100, 150, and 200 percent and when moving windows between monitors with different scaling. * For .NET Framework apps, confirm the app is configured for per-monitor DPI awareness before relying on crisp rendering across monitors. ## Theming * On .NET 9 and later, prefer the built-in Fluent theme for new apps and redesigns: set `ThemeMode="System"` on the `Application` (or a `Window`) to follow the Windows light and dark setting, or `Light` or `Dark` where the product requires it. Do not switch an existing app's theme as a side effect of another task. * Define colors and brushes as theme-aware resources so light, dark, and high-contrast modes all work, and test each of them. * Follow Windows conventions for window chrome, menus, dialogs, and settings, and keep text in resources so it can be localized.