ContentControl is not visible when application starts via UI Automation test, but its visible when application starts by user

后端 未结 3 2140
夕颜
夕颜 2021-02-20 13:53

We are using the prism and WPF to build application. Recently we started using UI Automation (UIA) to test our app. But some strange behavior occurred when we run UIA test. Here

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-20 14:32

    My guess is that the ContentControl's automation peer should update its children with AutomationPeer.ResetChildrenCache() after the view has been changed.

    AutomationPeer.InvalidatePeer() should have the same effect (in addition to other side effects) and it is supposed to be called automatically in response to the LayoutUpdated event. You might want to check that the LayoutUpdated event is raised when the view changes.

提交回复
热议问题