匯出 (0) 列印
全部展開
EN
本內容沒有您的語言版本,但有英文版本。

AutomationPeer.GetName Method

July 28, 2014

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Gets the value that the automation peer reports as the UI Automation Name for the associated control.

Namespace:  System.Windows.Automation.Peers
Assembly:  System.Windows (in System.Windows.dll)

public string GetName()

Return Value

Type: System.String
The value to report as the UI Automation Name.

Peers that affect the GetName value by overriding GetNameCore are generally implementing a behavior that can construct a usable UI Automation Name on basis of other property values of the associated control. For example, GetNameCore() implements a behavior that can process the button content by calling ToString on the content, and then returns the string so long as it is not empty or null. This enables a button composition such as <Button>OK</Button> to report its default UI Automation Name as "OK", without requiring any other usercode such as specifying AutomationProperties.Name.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Microsoft 正展開一份線上問卷調查,了解您對於 MSDN 網站的看法。 如果您選擇參加,您離開 MSDN 網站時即會顯示線上問卷調查。

您是否想要參加?
顯示:
© 2014 Microsoft