ButtonBaseAutomationPeer 类

定义

表示用于向 Microsoft UI 自动化公开从 ButtonBase 派生的类的基类。

public ref class ButtonBaseAutomationPeer : FrameworkElementAutomationPeer
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ButtonBaseAutomationPeer : FrameworkElementAutomationPeer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class ButtonBaseAutomationPeer : FrameworkElementAutomationPeer
Public Class ButtonBaseAutomationPeer
Inherits FrameworkElementAutomationPeer
继承
Object Platform::Object IInspectable DependencyObject AutomationPeer FrameworkElementAutomationPeer ButtonBaseAutomationPeer
派生
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

ButtonBaseAutomationPeer 具有受保护的构造函数,因此无法将其直接用于 OnCreateAutomationPeer 定义。 如果要从 ButtonBase 派生自定义类,并且想要为自定义类中启用的其他功能添加自动化支持,请从 ButtonBaseAutomationPeer 派生自动化对等。 然后重写 OnCreateAutomationPeer ,以便它返回自定义对等。 请注意 ,ButtonBase 已具有派生类,其中每个类也有派生对等,因此请确保确实希望从此基类派生,而不是使用现有的启用了 XAML 的派生按钮类之一。

ButtonBaseAutomationPeer 中的默认对等实现和重写

ButtonAutomationPeer 重写 了 Core 方法,以便关联的 AutomationPeer 方法向 Microsoft UI 自动化客户端提供对等特定的信息。

没有“ControlAutomationPeer”类。 FrameworkElementAutomationPeer 充当涉及 Microsoft UI 自动化的所有基本 Control 类方案的实现。 这包括不一定显示为公共 API 公开的行为,例如 AutomationPeer 中许多核心方法的实际实现。

FrameworkElementAutomationPeer 包括对等行为的广泛基本实现,其他对等方可以使用这些基本实现来报告来自 UIElementFrameworkElement 级别的所有者类的信息。 有关详细信息,请参阅 自定义自动化对等的“FrameworkElementAutomationPeer 中的基本实现”部分。

除了 Core 替代之外, FrameworkElementAutomationPeer 还有两个静态实用工具方法,这些方法可用于从控制代码中获取对等句柄,或从项容器对等方生成项对等方,以便获得 Microsoft UI 自动化支持。 它们是:

如果需要定义自定义自动化对等,并且无法标识与要从中派生所有者类的控件或基类配对的派生程度更高的对等类,则应将对等基于 FrameworkElementAutomationPeer。 即使所有者类不一定是 FrameworkElement,你实际上也无法直接从 AutomationPeer 派生对等,因为 FrameworkElementAutomationPeer 具有许多替代,这些替代提供布局、自动化和 UI 交互的预期行为。 至少需要从 UIElement 派生所有者类,否则无法通过 OnCreateAutomationPeer 在自动化树加载上创建对等。

ButtonBaseAutomationPeer 派生类

ButtonBaseAutomationPeer 是几个立即派生的类的父类,这些类实现对Windows 运行时控件的对等支持。 下面是直接派生自 ButtonBaseAutomationPeer 的类列表:

构造函数

ButtonBaseAutomationPeer(ButtonBase)

ButtonBase 派生类提供基类初始化行为。

属性

Dispatcher

获取与此 对象关联的 CoreDispatcherCoreDispatcher 表示可以访问 UI 线程上的 DependencyObject 的工具,即使代码是由非 UI 线程启动的。

(继承自 DependencyObject)
EventsSource

获取或设置一个 AutomationPeer, 它作为来自此 AutomationPeer 的所有事件的源报告给自动化客户端。 请参阅“备注”。

(继承自 AutomationPeer)
Owner

获取与此 FrameworkElementAutomationPeer 关联的 UIElement 所有者。

(继承自 FrameworkElementAutomationPeer)

方法

ClearValue(DependencyProperty)

清除依赖属性的本地值。

(继承自 DependencyObject)
GetAcceleratorKey()

获取与 UI 自动化对等互连的 对象的快捷键组合。

(继承自 AutomationPeer)
GetAcceleratorKeyCore()

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

(继承自 AutomationPeer)
GetAccessKey()

获取与自动化对等关联的元素的访问密钥。

(继承自 AutomationPeer)
GetAccessKeyCore()

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

(继承自 AutomationPeer)
GetAnimationBaseValue(DependencyProperty)

返回为依赖属性建立的任何基值,该基值适用于动画未处于活动状态的情况。

(继承自 DependencyObject)
GetAnnotations()

获取对当前自动化对等方 UI 自动化注释列表的引用。

(继承自 AutomationPeer)
GetAnnotationsCore()

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

(继承自 AutomationPeer)
GetAutomationControlType()

获取与 UI 自动化对等互连的元素的控件类型。

(继承自 AutomationPeer)
GetAutomationControlTypeCore()

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

(继承自 AutomationPeer)
GetAutomationId()

获取与自动化对等体关联的元素的 AutomationId

(继承自 AutomationPeer)
GetAutomationIdCore()

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

(继承自 AutomationPeer)
GetBoundingRectangle()

获取代表与自动化对等关联的元素的屏幕坐标的 Rect 对象。

(继承自 AutomationPeer)
GetBoundingRectangleCore()

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

(继承自 AutomationPeer)
GetChildren()

获取子元素的集合,这些子元素在 UI 自动化树中表示为自动化对等的直接子元素。

(继承自 AutomationPeer)
GetChildrenCore()

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

(继承自 AutomationPeer)
GetClassName()

获取与 AutomationControlType 一起使用的名称,以区分由此 AutomationPeer 表示的控件。

(继承自 AutomationPeer)
GetClassNameCore()

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

(继承自 AutomationPeer)
GetClickablePoint()

获取元素上的一个点,该点与响应鼠标单击的自动化对等方相关联。

(继承自 AutomationPeer)
GetClickablePointCore()

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

(继承自 AutomationPeer)
GetControlledPeers()

当 Microsoft UI 自动化客户端调用 GetControlledPeers 或等效的 Microsoft UI 自动化客户端 API(例如获取 由 UIA_ControllerForPropertyId 标识的属性值)时,提供对等行为。

(继承自 AutomationPeer)
GetControlledPeersCore()

获取当前自动化对等的受控对等互连的列表。

(继承自 AutomationPeer)
GetCulture()

调用 GetCultureCore 以获取与自动化对等体关联的元素的区域性值。

(继承自 AutomationPeer)
GetCultureCore()

获取与自动化对等体关联的元素的区域性值。

(继承自 AutomationPeer)
GetDescribedByCore()

获取元素的集合,这些元素提供有关自动化元素的详细信息。

(继承自 AutomationPeer)
GetElementFromPoint(Point)

从指定点获取元素。

(继承自 AutomationPeer)
GetElementFromPointCore(Point)

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

(继承自 AutomationPeer)
GetFlowsFromCore()

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

(继承自 AutomationPeer)
GetFlowsToCore()

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

(继承自 AutomationPeer)
GetFocusedElement()

获取当前具有焦点的元素。

(继承自 AutomationPeer)
GetFocusedElementCore()

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

(继承自 AutomationPeer)
GetFullDescription()

获取一个本地化字符串,该字符串描述图像或图像控件等内容的实际视觉外观或内容。

(继承自 AutomationPeer)
GetFullDescriptionCore()

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

(继承自 AutomationPeer)
GetHeadingLevel()

获取与此自动化对等互连的 UI 自动化元素的标题级别。

(继承自 AutomationPeer)
GetHeadingLevelCore()

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

(继承自 AutomationPeer)
GetHelpText()

获取描述与自动化同级关联的控件的功能的文本。

(继承自 AutomationPeer)
GetHelpTextCore()

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

(继承自 AutomationPeer)
GetItemStatus()

获取可传达与此自动化同级关联的元素的可视状态的文本。

(继承自 AutomationPeer)
GetItemStatusCore()

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

(继承自 AutomationPeer)
GetItemType()

获取描述元素所表示的项类型的字符串。

(继承自 AutomationPeer)
GetItemTypeCore()

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

(继承自 AutomationPeer)
GetLabeledBy()

获取以 元素为目标的 UIElementAutomationPeer

(继承自 AutomationPeer)
GetLabeledByCore()

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

(继承自 AutomationPeer)
GetLandmarkType()

获取此自动化对等方的陆标类型。

(继承自 AutomationPeer)
GetLandmarkTypeCore()

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

(继承自 AutomationPeer)
GetLevel()

返回与自动化对等互连的元素的级别 (层次结构) 从 1 开始的整数。

(继承自 AutomationPeer)
GetLevelCore()

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

(继承自 AutomationPeer)
GetLiveSetting()

获取与 UI 自动化对等方关联的对象的实时设置通知行为信息。

(继承自 AutomationPeer)
GetLiveSettingCore()

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

(继承自 AutomationPeer)
GetLocalizedControlType()

获取一个本地化字符串,该字符串表示与此自动化对等互连的控件的 AutomationControlType 值。

(继承自 AutomationPeer)
GetLocalizedControlTypeCore()

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

(继承自 AutomationPeer)
GetLocalizedLandmarkType()

获取一个本地化字符串,该字符串表示与此自动化对等关联的元素的 AutomationLandmarkType 值。

(继承自 AutomationPeer)
GetLocalizedLandmarkTypeCore()

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

(继承自 AutomationPeer)
GetName()

获取描述与此自动化同级关联的元素的文本。 Microsoft UI 自动化 名称 值是大多数辅助技术通过与 Microsoft UI 自动化框架交互来表示应用的 UI 时使用的主要标识符。

(继承自 AutomationPeer)
GetNameCore()

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

(继承自 AutomationPeer)
GetOrientation()

获取指示显式控件方向(如果有)的值。

(继承自 AutomationPeer)
GetOrientationCore()

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

(继承自 AutomationPeer)
GetParent()

获取此 AutomationPeer 的父级 AutomationPeer

(继承自 AutomationPeer)
GetPattern(PatternInterface)

获取与指定的 PatternInterface 关联的控件模式。

(继承自 AutomationPeer)
GetPatternCore(PatternInterface)

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

(继承自 AutomationPeer)
GetPeerFromPoint(Point)

从指定点获取 AutomationPeer

(继承自 AutomationPeer)
GetPeerFromPointCore(Point)

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

(继承自 AutomationPeer)
GetPositionInSet()

返回与自动化对等关联的元素的集中序号位置的从 1 开始的整数。

(继承自 AutomationPeer)
GetPositionInSetCore()

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

(继承自 AutomationPeer)
GetSizeOfSet()

返回与自动化对等关联的元素所在的集大小的从 1 开始的整数。

(继承自 AutomationPeer)
GetSizeOfSetCore()

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

(继承自 AutomationPeer)
GetValue(DependencyProperty)

DependencyObject 返回依赖属性的当前有效值。

(继承自 DependencyObject)
HasKeyboardFocus()

获取一个值,该值指示与此自动化同级关联的元素当前是否具有键盘焦点。

(继承自 AutomationPeer)
HasKeyboardFocusCore()

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

(继承自 AutomationPeer)
InvalidatePeer()

触发对 AutomationPeer main 属性的重新计算,并在属性发生更改时向自动化客户端发出 PropertyChanged 通知。

(继承自 AutomationPeer)
IsContentElement()

获取一个值,该值指示与此自动化对等方关联的元素是否包含向用户显示的数据。

(继承自 AutomationPeer)
IsContentElementCore()

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

(继承自 AutomationPeer)
IsControlElement()

获取一个值,该值指示用户是将元素理解为交互式元素,还是作为 GUI 中控件逻辑结构的贡献。

(继承自 AutomationPeer)
IsControlElementCore()

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

(继承自 AutomationPeer)
IsDataValidForForm()

获取一个布尔值,该值指示输入的值还是所选值对于与自动化元素关联的表单规则有效。

(继承自 AutomationPeer)
IsDataValidForFormCore()

提供 Microsoft UI 自动化客户端访问 IsDataValidForForm 或等效的 Microsoft UI 自动化客户端 API 时的对等行为。

(继承自 AutomationPeer)
IsDialog()

获取一个值,该值指示与此自动化对等互连关联的元素是否为对话窗口。

(继承自 AutomationPeer)
IsDialogCore()

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

(继承自 AutomationPeer)
IsEnabled()

获取一个值,该值指示与此自动化同级关联的元素是否支持交互。

(继承自 AutomationPeer)
IsEnabledCore()

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

(继承自 AutomationPeer)
IsKeyboardFocusable()

获取一个值,该值指示此元素是否可以接受键盘焦点。

(继承自 AutomationPeer)
IsKeyboardFocusableCore()

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

(继承自 AutomationPeer)
IsOffscreen()

获取一个值,该值指示元素是否不在屏幕上。

(继承自 AutomationPeer)
IsOffscreenCore()

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

(继承自 AutomationPeer)
IsPassword()

获取一个值,该值指示元素是否包含敏感内容。

(继承自 AutomationPeer)
IsPasswordCore()

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

(继承自 AutomationPeer)
IsPeripheral()

获取一个布尔值,该值指示自动化元素是否表示外围 UI。

(继承自 AutomationPeer)
IsPeripheralCore()

在 Microsoft UI 自动化客户端访问 IsPeripheral 或等效的 Microsoft UI 自动化客户端 API 时提供对等行为。

(继承自 AutomationPeer)
IsRequiredForForm()

获取一个值,该值指示是否必须在窗体中完成与此同级关联的元素。

(继承自 AutomationPeer)
IsRequiredForFormCore()

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

(继承自 AutomationPeer)
Navigate(AutomationNavigationDirection)

获取 UI 自动化树中指定方向的元素。

(继承自 AutomationPeer)
NavigateCore(AutomationNavigationDirection)

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

(继承自 AutomationPeer)
PeerFromProvider(IRawElementProviderSimple)

获取指定 IRawElementProviderSimple 代理的 AutomationPeer

(继承自 AutomationPeer)
ProviderFromPeer(AutomationPeer)

获取指定 AutomationPeerIRawElementProviderSimple 代理。

(继承自 AutomationPeer)
RaiseAutomationEvent(AutomationEvents)

引发自动化事件。

(继承自 AutomationPeer)
RaiseNotificationEvent(AutomationNotificationKind, AutomationNotificationProcessing, String, String)

启动通知事件。

(继承自 AutomationPeer)
RaisePropertyChangedEvent(AutomationProperty, Object, Object)

引发事件以通知自动化客户端已更改的属性值。

(继承自 AutomationPeer)
RaiseStructureChangedEvent(AutomationStructureChangeType, AutomationPeer)

引发事件以通知 Microsoft UI 自动化核心树结构已更改。

(继承自 AutomationPeer)
RaiseTextEditTextChangedEvent(AutomationTextEditChangeType, IVectorView<String>)

引发事件以通知 Microsoft UI 自动化核心文本控件已以编程方式更改文本。

(继承自 AutomationPeer)
ReadLocalValue(DependencyProperty)

如果设置了本地值,则返回依赖属性的本地值。

(继承自 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

注册一个通知函数,用于侦听此 DependencyObject 实例上特定 DependencyProperty 的更改。

(继承自 DependencyObject)
SetFocus()

对与此自动化同级关联的元素设置键盘焦点。

(继承自 AutomationPeer)
SetFocusCore()

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

(继承自 AutomationPeer)
SetParent(AutomationPeer)

设置此 AutomationPeer 的父级的 AutomationPeer

(继承自 AutomationPeer)
SetValue(DependencyProperty, Object)

设置 DependencyObject 上依赖属性的本地值。

(继承自 DependencyObject)
ShowContextMenu()

显示所有者元素的可用上下文菜单。

(继承自 AutomationPeer)
ShowContextMenuCore()

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

(继承自 AutomationPeer)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消以前通过调用 RegisterPropertyChangedCallback 注册的更改通知。

(继承自 DependencyObject)

适用于

另请参阅