WPF性能问题,由于UI自动化 [英] WPF performance issue due to UI Automation

查看:335
本文介绍了WPF性能问题,由于UI自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的<一个描述的问题href="http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110">this螺纹。

dotTrace告诉我:手写输入是有罪的。

dotTrace told me "Stylus Input" was guilty.

我试过<一个href="http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110">the发表 href="http://social.msdn.microsoft.com/profile/ron%20z/?type=forum&referrer=http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110">Ron ž哈伊姆Zonnenberg ,但没有奏效。

I tried the code posted by Ron Z and Chaim Zonnenberg, but didn't work.

皮疹建议2解决方法:

  1. 自动化code将被触发只要有任何的自动化客户端(如屏幕阅读器,tabtip在平板电脑等)在本机运行。因此,要摆脱这种局面的一个方法是关闭所有的自动化客户端应用程序。

  1. Automation code will be triggered only if there are any automation clients ( like screen reader, tabtip in tablet pcs, etc) running in the machine. So one way to get out of this situation is to close any of those automation client apps.

如果一个是不可行那么替代方案是,UIElementHelper.InvalidateAutomationAncestors将需要更长的时间才自动化树的应用程序是稀疏的(如果有残疾的楼宇自动化树使用自定义窗口自动化等情况)和视觉树稠密。因此,另一种解决办法是禁用任何自定义的自动化code和允许WPF来构建完整的自动化树。这应该加快UIElementHelper.InvalidateAutomationAncestors为好。

If one is not feasible then an alternative is, UIElementHelper.InvalidateAutomationAncestors will take longer time only if automation tree for the app is sparse ( happens if had disabled building automation tree using custom window automation peer) and visual tree is dense. So another solution is disable any custom automation code and allow WPF to build complete automation tree. This should speed up UIElementHelper.InvalidateAutomationAncestors as well.

但如何关闭tabtip?我试图阻止和禁用下列服务,但没有工作,tabtip.exe仍然在后台运行:

But how to close tabtip? I tried to stop and disable the following services but didn't work, tabtip.exe was still running in the background:

  • 在Tablet PC输入服务
  • TabletServicePen

皮疹说这个问题应该在.NET 4.0 SP1中得到解决。任何人都知道的.NET 4.0 SP1的发布日期?

Rash said this issue should be solved in .NET 4.0 SP1. Anyone knows the release date of .NET 4.0 SP1?

我在使用Visual Studio 2010,Windows 7的64位,Wacom的Graphire 4。

I'm using Visual Studio 2010, Windows 7 64bit, Wacom Graphire 4.

感谢

更新

要关闭tabtip.exe我只需要禁用上述服务后,重新启动Windows。但仅此并没有解决我的问题。为了要解决性能问题,我也必须禁用Wacom的消费者触控服务。

To close tabtip.exe I just need to restart Windows after disabling the aforementioned services. But this alone didn't solve my issue. In order to workaround the performance issue, I have to also disable "Wacom Consumer Touch Service".

和按<一个href="http://social.msdn.microsoft.com/Forums/is/wpf/thread/d6e71f13-d7ac-44f2-8c21-af52b9fe2bc3">this螺纹(2011年3月22日):

And according to this thread (March 22, 2011):

没有公布时间表用于.NET Framework 4.0 SP1

推荐答案

最近,我不得不应付使用我们的项目一个WPF工具,这个确切的问题。

I recently had to deal with this exact problem using a WPF tool on our project.

本机所在的崩盘发生的一切正在运行的.NET Framework 4.5。

The machine where the crash was happening is running .NET Framework 4.5.

当工具被撞毁,我们可以看到的崩溃发生在.NET presentationFramework UIAutomation。 这次事故的例外是:第一次机会异常类型System.ArgumentOutOfRangeException发生在presentationFramework.dll - >在这一点上的错误似乎是在.NET框架

When the tool was crashing we could see the crash happening in .NET PresentationFramework UIAutomation. The crash exception was: A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in PresentationFramework.dll --> at this point the bug appeared to be in .NET Framework

但后来我们可以看到下来,我们坠毁在一个UIAutomation调用堆栈,导致我们这个线程并推断该模块是由Wacom的服务被触发。

But then we could see down the stack that we crashed in a UIAutomation call, that lead us to this thread and figured that this module is being trigger by the Wacom services.

本机所在的应用程序崩溃上运行的Wacom的驱动力是:Wacom数位板6.3.1w3 降级到previous版本的一切后开始工作:WacomTablet_6.3.3-4

The Wacom driver running on the machine where the app is crashing was: Wacom Tablet 6.3.1w3 After downgrading to the previous version everything started working: WacomTablet_6.3.3-4

现在,我们知道,我们开始寻找到一个解决方法,以便能够仍然使用了最新的驱动程序问题的根源。 所以这里的,什么是好的是,似乎它不会影响Wacom数位板功能: - 进入控制面板。 - 双击程序和功能 - 点击左侧标题打开链接Windows功能打开或关闭 - 当该负载,取消选中平板电脑的可选组件(可能在Windows 7中被称为平板电脑组件)。 - 单击确定按钮。 这可能需要您重新启动Windows机器。

Now that we knew the source of the problem we started looking into a workaround to be able to still use the latest driver. So here it is and what's nice is that it don’t seem to affect the wacom tablet functionality: - Go to Control Panel. - Double click on Programs and Features - Click on the link on the left titled Turn Windows Features on or off - When that loads, uncheck ‘Tablet PC Optional Components’ (Might be called ‘Tablet PC Components’ in Windows 7). - Click the OK button. This might require you to restart your windows machine.

而这奏效了我们。

玩得开心!

这篇关于WPF性能问题,由于UI自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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