有什么办法可以使用UIAutomation访问依赖项属性 [英] Is there any way to access Dependency Properties using UIAutomation

查看:141
本文介绍了有什么办法可以使用UIAutomation访问依赖项属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用于很多事情,是否可以使用UIAutomation访问控件上的这些设置?

in WPF Dependency Properties are a used for many things, is it possible to access theses settings on the controls with UIAutomation?

推荐答案

Throndorin,

WPF中的依赖项属性,与UI实现的大多数方面一样,都是应用程序专用的.您可以从调试器看到它​​们,但不能从应用程序的过程中看到它们.

如果存在与有用的UIA属性匹配的依赖项属性,则可以使用WPF可访问性支持来实现该UIA属性并让您的实现返回依赖项属性的值.简而言之,您必须将其连接起来-它不是免费提供的.

(您可以想象一下,如果它是免费提供的-您应用程序的内部详细信息,私有数据和可以通过UISpy之类的工具看到所有秘密!选择加入模型似乎更好.)

谢谢,
Michael
Hi, Throndorin,

Dependency Properties in WPF, like most aspects of UI implementation, are private to the application.  You can see them from a debugger, but not from outside of the application's process.

If there is a dependency property that matches a useful UIA property, you could use WPF Accessibility support to implement that UIA property and have your implementation return the value of the dependency property.  In short, you'd have to hook it up -- it doesn't come for free.

(You can imagine if this did come for free -- your application's internal details, private data, and secrets would be all visible through a tool like UISpy!  An opt-in model seems better.)

Thanks,
Michael


这篇关于有什么办法可以使用UIAutomation访问依赖项属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆