c# - 如何将不受支持的模式添加到 AutomationElement? AutomationPeers 会更改被测应用程序吗?

标签 c# wpf microsoft-ui-automation

以下自定义控件 ToggleButton 不支持 InvokePattern。

<ToggleButton   Click="click_event" 
... />

我该怎么做才能在某些 UIA 模式上执行 ToggleButton 的点击事件?


这个link提供有关 AutomationPeer 和自定义控件的信息。但似乎我需要更改被测应用程序(AUT)才能使用这个定制的 AutomationPeer?! Guideline if you are allowed to change the AUT

最佳答案

切换按钮不支持InvokePattern ,但他们确实支持 TogglePattern 。您根本不需要深入研究自动化同行。

关于c# - 如何将不受支持的模式添加到 AutomationElement? AutomationPeers 会更改被测应用程序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23547085/

相关文章:

c# - 无法获取页面的 HTML

.net - 使用 Microsoft UI Automation 获取所有 Firefox 打开的 URL

automation - Microsoft UI 自动化框架是否适用于 Chrome、Python 和 Java 应用程序?

C# WPF : Getting Custom Binding Error (Converter Property Unknown) After Restoring Project from SourceSafe

c# - 使用 UIAutomation 选择网格中存在的复选框

c# - Entity Framework ,返回日期错误

c# - 如何在 C# 中最小化单个 Windows 应用程序窗体

c# - 使用 CSWinRT 调用 .net5 windows api

c# - WPF - 从代码隐藏/附加行为绑定(bind)到显式实现的接口(interface)属性

WPF ScrollViewer 在窗口调整大小时未激活