How to use AutomationProperties.Name?

廉价感情. 提交于 2019-12-03 11:30:15

You can change the attached property AutomationProperties.Name either in XAML using:

AutomationProperties.Name = "new name"

or in code using:

Button.SetValue(AutomationProperties.NameProperty, "new value");
or
AutomationProperties.SetName(Button, "new value");

Babu A

You can pass the Window Title as parameter to its parent and set this parameter while initializing.

I do this way and works fine.

There is a way to work around that but its a bit ugly.

We will be using the fact that the the proprty that contains the reference to the window is cached and not looked up every time.

uimap class is a partial class and you can have code in the uimap.cs file that stil counts as a part of the uimap class.

Add a method there that accepts as a parameter the window title, and performs the search, and that puts the found window into the UIListViewPropertiesTable1 property of the generated code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!