共用方式為


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 自動化識別碼值。

適用於

另請參閱