Can UI Automation be disabled for an entire WPF 4.0 app?

前端 未结 5 1117
死守一世寂寞
死守一世寂寞 2021-01-30 09:47

We are developing a WPF 4.0 application for internal use.
On some clients, we are experiencing huge performance issues due to UI automation (these clients have software i

5条回答
  •  臣服心动
    2021-01-30 09:59

    We had the same issue with DevExpress controls. Neither workaround code helps to us. And I suppose that there is not any "switch" to disable UI Automation. But since last versions DevExpress have magic ClearAutomationEventsHelper class that do some tricks. As I understood, the idea is to clear AutomationEvents.Count property (via Reflection) for controls that cause issue. E.g., they call this method in their base controls (from MeasureOverride), or each time automation peer created.

    If you use DevExpress, this class can be silver bullet for your project. We able totally avoid side effects of UI Automation issues in our WPF 4.0 projects and customers were really happy.

提交回复
热议问题