UI オートメーション フレームワークを介して WPF UserControl DependencyProperty 値にアクセスできません。
MSDN の James McCaffrey の記事 (Automating IO Tests in WPF Applications, MSDN March 2009) を出発点として使用しましたが、ボタンなどの標準コントロールのプロパティなどしか表示できません。
UserControl に実装しなければならない Automation インターフェイスがあると仮定していますが、何をどのように実装するのでしょうか?
UISpy などでコントロールを正常に表示できますが、その中に依存関係のプロパティが表示されません。UISpy での現在のユーザー コントロールの外観は次のとおりです。
AutomationElement General Accessibility AccessKey: "" AcceleratorKey: "" IsKeyboardFocusable: "False" LabeledBy: "(null)" HelpText: "48v ファンタム電源のオン/オフを切り替えます (マイク入力のみ)。"
状態 IsEnabled: "True" HasKeyboardFocus: "False"
識別 ClassName: "" ControlType: "ControlType.Custom" Culture: "(null)" AutomationId: "V48SwL" LocalizedControlType: "custom" Name: "" ProcessId: "5684 (VirtualSix)" RuntimeId: "7 5684 40026340" IsPassword: "False" IsControlElement: "True" IsContentElement: "True"
Visibility BoundingRectangle: "(140, 457, 31, 20)" ClickablePoint: "155,467" IsOffscreen: "False"
コントロールパターン