AutomationProperties.SetAutomationId(DependencyObject, String) 方法

定义

设置指定 DependencyObjectAutomationProperties.AutomationId 附加属性的值。

public:
 static void SetAutomationId(DependencyObject ^ element, Platform::String ^ value);
 static void SetAutomationId(DependencyObject const& element, winrt::hstring const& value);
public static void SetAutomationId(DependencyObject element, string value);
function setAutomationId(element, value)
Public Shared Sub SetAutomationId (element As DependencyObject, value As String)

参数

element
DependencyObject

要为其设置 属性的 DependencyObject

value
String

Platform::String

winrt::hstring

要设置的 UI 自动化标识符值。

适用于