AutomationPeer.GetAutomationControlTypeCore 方法

定义

在 Microsoft UI 自动化客户端调用 GetAutomationControlType 或等效的 Microsoft UI 自动化客户端 API 时提供对等行为。

protected:
 virtual AutomationControlType GetAutomationControlTypeCore() = GetAutomationControlTypeCore;
AutomationControlType GetAutomationControlTypeCore();
protected virtual AutomationControlType GetAutomationControlTypeCore();
function getAutomationControlTypeCore()
Protected Overridable Function GetAutomationControlTypeCore () As AutomationControlType

返回

控件类型。

注解

AutomationPeerFrameworkElementAutomationPeer 的基本实现返回 Custom。 如果保留此行为,则必须替代 GetLocalizedControlTypeCore

定义自动化对等的更常见方案是重写与要重写的控件类配对的现有对等类之一。 在这种情况下,每个此类对等类都报告 AutomationControlType 的实际值,该值对于实现对等的原始所有者控件有意义。 通常,你可以保留此行为。 通常,从特定于控件的对等派生并使用其行为,但随后更改 AutomationControlType,这可能是对等方报告的最基本信息。 检查要重写的对等类的现有行为,并验证是否报告了正确的控件类型。 此外,双检查,没有更具体的对等类可用于报告正确的控件类型,并提供更适合对等的其他行为。 有关详细信息,请参阅自定义的自动化对等

适用于

另请参阅