【发布时间】:2011-07-17 08:03:49
【问题描述】:
我正在使用 UIAutomation 做一些工作,需要在 WPF 中获取 AvalonEdit 控件的内容。我只能将 AvalonEdit 控件作为文本的 ControlType:
var editors = app.FindAll(TreeScope.Descendants, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text));
不支持此功能...
var targetTextPattern = editor[0].GetCurrentPattern( TextPattern.Pattern) as TextPattern;
我似乎找不到从中提取文本内容的方法,使用 ControlType.Text 时不可能吗?我也尝试过使用 ControlType Edit & Document 但 AvalonEdit 似乎不支持它们。
感谢任何帮助。 谢谢!
【问题讨论】:
标签: wpf ui-automation avalonedit