UIElement 类

定义

UIElement 是大多数Windows 运行时 UI 对象的基类,这些对象具有视觉外观,并且可以作为应用用户界面的一部分处理基本输入。

public ref class UIElement : DependencyObject
public ref class UIElement : DependencyObject, IAnimationObject
public ref class UIElement : DependencyObject, IAnimationObject, IVisualElement
/// [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 UIElement : DependencyObject
/// [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 UIElement : DependencyObject, IAnimationObject
/// [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 UIElement : DependencyObject, IAnimationObject, IVisualElement
[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 UIElement : DependencyObject
[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 UIElement : DependencyObject, IAnimationObject
[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 UIElement : DependencyObject, IAnimationObject, IVisualElement
Public Class UIElement
Inherits DependencyObject
Public Class UIElement
Inherits DependencyObject
Implements IAnimationObject
Public Class UIElement
Inherits DependencyObject
Implements IAnimationObject, IVisualElement
继承
Object Platform::Object IInspectable DependencyObject UIElement
派生
属性
实现

Windows 要求

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

注解

UIElement 是一个基元素:它是许多其他Windows 运行时类继承的类,以支持 XAML UI 元素模型。 UIElement 定义的属性、方法和事件由数百个其他Windows 运行时类继承。

尽管 UIElement (GotFocusLostFocus) 定义焦点报告事件,但 UIElement 不定义用于以编程方式设置焦点的 API。 此功能由 Control 类定义。

UIElement 不公开公共构造函数。 通常,不会直接从 UIElement 或 FrameworkElement 派生类。 派生自定义类更常用的基类包括以下类:

UIElement 类用作 Windows 运行时 API 中许多属性和方法的类型参数。 例如,BorderChild 属性采用单个 UIElement,它表示绘制边框的元素。 可以为此类属性提供任何 UIElement 派生元素,包括定义的自定义控件。

UIElementCollection 类提供 UIElement 项的强类型集合。 UIElementCollection 用作包含多个子元素的对象的属性的类型,例如,对于任何 Panel 类的 Children 属性。

UIElement API 和功能

UIElement 扩展了 DependencyObject(另一个基元素),并添加了对各种Windows 运行时功能区域的支持。

用于响应用户交互的输入和事件

UI 中可见元素的很多输入行为都是在 UIElement 类中定义的。 这包括键盘、鼠标、触摸、拖放和焦点交互的事件。 有关详细信息,请参阅 处理指针输入键盘交互自定义用户交互

支持输入和用户交互的 UIElement 的突出 API:

手势和操作

手势和操作也是处理输入和用户交互的一种方法。 API 在此处单独列出,因为这些事件表示系统如何与设备级输入操作交互,并将其解释为用户交互。 操作是处理动态多点触控交互(如收缩和拉伸)的一种方法。 手势和操作共同提供用于与 UWP 应用的触摸交互的触摸模式。 有关详细信息,请参阅 自定义用户交互触摸交互设计

支持手势和操作的 UIElement 的突出 API:

基本外观

VisibilityOpacity 属性通常用于调整 UI 中元素的外观,尤其是在样式、模板和视觉状态中。 ClipRenderTransformTransitions 属性都可用于生成 UI 元素的交互和不同的外观。

基本布局

UIElement 类为具有 DesiredSizeArrangeMeasure 方法等属性的布局特征提供起点。 FrameworkElement 添加了更多布局功能。 有关详细信息,请参阅使用 XAML 和 FrameworkElement定义布局

路由事件

UIElement 的大多数输入事件都是 路由事件。 路由事件启用内置的事件处理通知系统,以便父对象可以在事件仍未处理的情况下处理来自对象树中子对象的输入事件。 此输入事件行为对于输入区域分组和控件合成非常有用。 有关详细信息,请参阅事件和路由事件概述

支持路由事件的 UIElement 的突出 API: AddHandlerRemoveHandler、*Event 属性。

其他平台支持

UIElement 依赖属性

UIElement 基元素类的许多读写属性都是依赖属性。 依赖属性支持使用 C++、C# 或 Visual Basic 的 UWP 应用的某些基本编程模型功能,例如样式和模板、数据绑定、XAML 资源引用和属性更改逻辑。 有关依赖属性及其支持的功能的详细信息,请参阅 依赖属性概述

UIElement 派生类

唯一直接从 UIElement 派生Windows 运行时类是 FrameworkElement。 有关派生自 FrameworkElement 的类的列表,请参阅 FrameworkElement 参考主题的“ FrameworkElement 派生类”部分。

版本历史记录

Windows 版本 SDK 版本 增值
1607 14393 AccessKey
1607 14393 AccessKeyDisplayDismissed
1607 14393 AccessKeyDisplayRequested
1607 14393 AccessKeyInvoked
1607 14393 AccessKeyScopeOwner
1607 14393 ContextCanceled
1607 14393 ContextFlyout
1607 14393 ContextRequested
1607 14393 ExitDisplayModeOnAccessKeyInvoked
1607 14393 IsAccessKeyScope
1703 15063 GettingFocus
1703 15063 GettingFocusEvent
1703 15063 HighContrastAdjustment
1703 15063 KeyTipHorizontalOffset
1703 15063 KeyTipPlacementMode
1703 15063 KeyTipVerticalOffset
1703 15063
1703 15063 LosingFocus
1703 15063 LosingFocusEvent
1703 15063 NoFocusCandidateFound
1703 15063 NoFocusCandidateFoundEvent
1703 15063 StartBringIntoView
1703 15063 StartBringIntoView (BringIntoViewOptions)
1703 15063 TabFocusNavigation
1703 15063 XYFocusDownNavigationStrategy
1703 15063 XYFocusKeyboardNavigation
1703 15063 XYFocusLeftNavigationStrategy
1703 15063 XYFocusRightNavigationStrategy
1703 15063 XYFocusUpNavigationStrategy
1709 16299 CharacterReceived
1709 16299 CharacterReceivedEvent
1709 16299 GetChildrenInTabFocusOrder
1709 16299 KeyboardAccelerators
1709 16299 OnProcessKeyboardAccelerators
1709 16299 PreviewKeyDown
1709 16299 PreviewKeyDownEvent
1709 16299 PreviewKeyUp
1709 16299 PreviewKeyUpEvent
1709 16299 ProcessKeyboardAccelerators
1709 16299 TryInvokeKeyboardAccelerator
1803 17134 BringIntoViewRequested
1803 17134 BringIntoViewRequestedEvent
1803 17134 ContextRequestedEvent
1803 17134 KeyboardAcceleratorPlacementMode
1803 17134 KeyboardAcceleratorPlacementTarget
1803 17134 KeyTipTarget
1803 17134 OnBringIntoViewRequested
1803 17134 OnKeyboardAcceleratorInvoked
1803 17134 RegisterAsScrollPort
1809 17763 CanBeScrollAnchor
1809 17763 CenterPoint
1809 17763 OpacityTransition
1809 17763 PopulatePropertyInfo
1809 17763 PopulatePropertyInfoOverride
1809 17763 旋转
1809 17763 RotationAxis
1809 17763 RotationTransition
1809 17763 缩放
1809 17763 ScaleTransition
1809 17763 StartAnimation
1809 17763 StopAnimation
1809 17763 TransformMatrix
1809 17763 翻译
1809 17763 TranslationTransition
1903 18362 ActualOffset
1903 18362 ActualSize
1903 18362 Shadow
1903 18362 UIContext
1903 18362 XamlRoot

属性

AccessKey

获取或设置此元素的访问键 (助记) 。

AccessKeyProperty

标识 AccessKey 依赖属性。

AccessKeyScopeOwner

获取或设置一个源元素,该元素提供此元素的访问键范围,即使它不在源元素的可视化树中也是如此。

AccessKeyScopeOwnerProperty

标识 AccessKeyScopeOwner 依赖属性。

ActualOffset

获取此 UIElement 相对于其父级的位置,该位置在布局过程的排列过程期间计算。

ActualSize

获取此 UIElement 在布局过程的排列过程中计算的大小。

AllowDrop

获取或设置一个值,该值确定此 UIElement 是否可以作为拖放操作的放置目标。

AllowDropProperty

标识 AllowDrop 依赖属性。

BringIntoViewRequestedEvent

获取 BringIntoViewRequested 路由事件的标识符。

CacheMode

获取或设置一个值,该值指示应尽可能将呈现的内容缓存为复合位图。

CacheModeProperty

标识 CacheMode 依赖属性。

CanBeScrollAnchor

获取或设置一个值,该值指示 UIElement 是否可以成为滚动定位的候选项。

CanBeScrollAnchorProperty

标识 CanBeScrollAnchor 依赖属性。

CanDrag

获取或设置一个值,该值指示是否可以在拖放操作中将元素作为数据拖动。

CanDragProperty

标识 CanDrag 依赖属性。

CenterPoint

获取或设置 元素的中心点,该中心点是关于发生旋转或缩放的点。 影响元素的呈现位置。

CharacterReceivedEvent

获取 CharacterReceived 路由事件的标识符。

Clip

获取或设置用于定义 UIElement 内容的大纲的 RectangleGeometry

ClipProperty

标识 Clip 依赖属性。

CompositeMode

获取或设置一个属性,该属性声明元素在其父布局和窗口中的替代组合和混合模式。 这与混合 XAML/Microsoft DirectX UI 中涉及的元素相关。

CompositeModeProperty

标识 CompositeMode 依赖属性。

ContextFlyout

获取或设置与此元素关联的浮出控件。

ContextFlyoutProperty

ContextFlyout 依赖属性标识。

ContextRequestedEvent

获取 ContextRequested 路由事件的标识符。

DesiredSize

获取此 UIElement 在布局过程的度量传递期间计算的大小。

Dispatcher

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

(继承自 DependencyObject)
DoubleTappedEvent

获取 DoubleTapped 路由事件的标识符。

DragEnterEvent

获取 DragEnter 路由事件的标识符。

DragLeaveEvent

获取 DragLeave 路由事件的标识符。

DragOverEvent

获取 DragOver 路由事件的标识符。

DropEvent

获取 Drop 路由事件的标识符。

ExitDisplayModeOnAccessKeyInvoked

获取或设置一个值,该值指定在调用访问密钥时是否消除访问密钥显示。

ExitDisplayModeOnAccessKeyInvokedProperty

标识 ExitDisplayModeOnAccessKeyInvoked 依赖属性。

GettingFocusEvent

获取 GettingFocus 路由事件的标识符。

HighContrastAdjustment

获取或设置一个值,该值指示框架是否在启用高对比度主题时自动调整元素的视觉属性。

HighContrastAdjustmentProperty

标识 HighContrastAdjustment 依赖属性。

HoldingEvent

获取 保留 路由事件的标识符。

IsAccessKeyScope

获取或设置一个值,该值指示元素是否定义其自己的访问键范围。

IsAccessKeyScopeProperty

标识 IsAccessKeyScope 依赖属性。

IsDoubleTapEnabled

获取或设置一个值,该值确定 DoubleTapped 事件是否可以源自该元素。

IsDoubleTapEnabledProperty

标识 IsDoubleTapEnabled 依赖属性。

IsHitTestVisible

获取或设置此 UIElement 的包含区域是否可以为命中测试返回 true 值。

IsHitTestVisibleProperty

标识 IsHitTestVisible 依赖属性。

IsHoldingEnabled

获取或设置一个值,该值确定 Holding 事件是否可以源自该元素。

IsHoldingEnabledProperty

标识 IsHoldingEnabled 依赖属性。

IsRightTapEnabled

获取或设置一个值,该值确定 RightTapped 事件是否可以源自该元素。

IsRightTapEnabledProperty

标识 IsRightTapEnabled 依赖属性。

IsTapEnabled

获取或设置一个值,该值确定 Tapped 事件是否可以源自该元素。

IsTapEnabledProperty

标识 IsTapEnabled 依赖属性。

KeyboardAcceleratorPlacementMode

获取或设置一个值,该值指示控件 工具提示 是否显示其关联的键盘快捷键的组合键。

KeyboardAcceleratorPlacementModeProperty

标识 KeyboardAcceleratorPlacementMode 依赖属性。

KeyboardAcceleratorPlacementTarget

获取或设置一个值,该值指示显示快捷键组合的控件 工具提示

KeyboardAcceleratorPlacementTargetProperty

标识 KeyboardAcceleratorPlacementTarget 依赖属性。

KeyboardAccelerators

获取使用键盘调用操作的组合键的集合。

加速器通常分配给按钮或菜单项。

显示各种菜单项的键盘快捷键的菜单示例
显示各种菜单项的键盘快捷键的菜单示例

KeyDownEvent

获取 KeyDown 路由事件的标识符。

KeyTipHorizontalOffset

获取或设置一个值,该值指示键提示相对于 UIElement 的左或右放置距离。

KeyTipHorizontalOffsetProperty

标识 KeyTipHorizontalOffset 依赖属性。

KeyTipPlacementMode

获取或设置一个值,该值指示相对于 UIElement 边界放置访问键提示的位置。

KeyTipPlacementModeProperty

标识 KeyTipPlacementMode 依赖属性。

KeyTipTarget

获取或设置一个值,该值指示访问键提示所针对的元素。

KeyTipTargetProperty

标识 KeyTipTarget 依赖属性。

KeyTipVerticalOffset

获取或设置一个值,该值指示键提示相对于 UI 元素的放置距离。

KeyTipVerticalOffsetProperty

标识 KeyTipVerticalOffset 依赖属性。

KeyUpEvent

获取 KeyUp 路由事件的标识符。

Lights

获取附加到此元素的 XamlLight 对象的集合。

LightsProperty

标识 Lights 依赖属性。

LosingFocusEvent

获取 LosingFocus 路由事件的标识符。

ManipulationCompletedEvent

获取 ManipulationCompleted 路由事件的标识符。

ManipulationDeltaEvent

获取 ManipulationDelta 路由事件的标识符。

ManipulationInertiaStartingEvent

获取 ManipulationInertiaStarting 路由事件的标识符。

ManipulationMode

获取或设置用于 UIElement 行为和手势交互的 ManipulationModes 值。 设置此值可处理应用代码中此元素的操作事件。

ManipulationModeProperty

标识 ManipulationMode 依赖属性。

ManipulationStartedEvent

获取 ManipulationStarted 路由事件的标识符。

ManipulationStartingEvent

获取 ManipulationStarting 路由事件的标识符。

NoFocusCandidateFoundEvent

获取 NoFocusCandidateFound routed 事件的标识符。

Opacity

获取或设置对象的不透明度的程度。

OpacityProperty

标识 IsHitTestVisible 依赖属性。

OpacityTransition

获取或设置对 Opacity 属性的更改进行动画处理的 ScalarTransition。

PointerCanceledEvent

获取 PointerCanceled 路由事件的标识符。

PointerCaptureLostEvent

获取 PointerCaptureLost 路由事件的标识符。

PointerCaptures

获取所有捕获的指针的集合,表示为 Pointer 值。

PointerCapturesProperty

标识 PointerCaptures 依赖属性。

PointerEnteredEvent

获取 PointerEntered 路由事件的标识符。

PointerExitedEvent

获取 PointerExited 路由事件的标识符。

PointerMovedEvent

获取 PointerMoved 路由事件的标识符。

PointerPressedEvent

获取 PointerPressed 路由事件的标识符。

PointerReleasedEvent

获取 PointerReleased 路由事件的标识符。

PointerWheelChangedEvent

获取 PointerWheelChanged 路由事件的标识符。

PreviewKeyDownEvent

获取 PreviewKeyDown 路由事件的标识符。

PreviewKeyUpEvent

获取 PreviewKeyUp 路由事件的标识符。

Projection

获取或设置呈现此元素时要应用的透视投影 (三维效果) 。

ProjectionProperty

标识 投影 依赖属性。

RenderSize

获取 UIElement 的最终呈现大小。 不建议使用 ,请参阅备注。

RenderTransform

获取或设置影响 UIElement 呈现位置的转换信息。

RenderTransformOrigin

获取或设置 RenderTransform 声明的任何可能的呈现转换相对于 UIElement 边界的原点。

RenderTransformOriginProperty

标识 RenderTransformOrigin 依赖属性。

RenderTransformProperty

标识 RenderTransform 依赖属性。

RightTappedEvent

获取 RightTapped 路由事件的标识符。

Rotation

获取或设置顺时针旋转的角度(以度为单位)。 相对于 RotationAxis 和 CenterPoint 旋转。 影响元素的呈现位置。

RotationAxis

获取或设置要围绕元素旋转的轴。

RotationTransition

获取或设置对 Rotation 属性的更改进行动画处理的 ScalarTransition。

Scale

获取或设置元素的刻度。 相对于元素的 CenterPoint 缩放。 影响元素的呈现位置。

ScaleTransition

获取或设置对 Scale 属性的更改进行动画处理的 Vector3Transition。

Shadow

获取或设置元素投射的阴影效果。

ShadowProperty

标识 Shadow 依赖属性。

TabFocusNavigation

获取或设置一个值,该值修改 Tabbing 和 TabIndex 对此控件的工作方式。

TabFocusNavigationProperty

标识 TabFocusNavigation 依赖属性。

TappedEvent

获取 Tapped 路由事件的标识符。

Transform3D

获取或设置呈现此元素时要应用的三维转换效果。

Transform3DProperty

标识 Transform3D 依赖属性。

TransformMatrix

获取或设置要应用于元素的转换矩阵。

Transitions

获取或设置应用于 UIElementTransition 样式元素的集合。

TransitionsProperty

标识 Transitions 依赖属性。

Translation

获取或设置元素的 x、y 和 z 呈现位置。

TranslationTransition

获取或设置对 Translation 属性的更改进行动画处理的 Vector3Transition。

UIContext

获取 元素的上下文标识符。

UseLayoutRounding

获取或设置一个值,该值确定对象及其可视子树的呈现是否应使用使呈现与整个像素对齐的舍入行为。

UseLayoutRoundingProperty

标识 UseLayoutRounding 依赖属性。

Visibility

获取或设置 UIElement 的可见性。 不可见的 UIElement 不会呈现,也不会将其所需大小传达给布局。

VisibilityProperty

标识 Visibility 依赖属性。

XamlRoot

获取或设置 XamlRoot 在其中查看此元素的 。

XYFocusDownNavigationStrategy

获取或设置一个值,该值指定用于确定向下导航的目标元素的策略。

XYFocusDownNavigationStrategyProperty

标识 XYFocusDownNavigationStrategy 依赖属性。

XYFocusKeyboardNavigation

获取或设置一个值,该值使用键盘方向箭头启用或禁用导航。

XYFocusKeyboardNavigationProperty

标识 XYFocusKeyboardNavigation 依赖属性。

XYFocusLeftNavigationStrategy

获取或设置一个值,该值指定用于确定左侧导航的目标元素的策略。

XYFocusLeftNavigationStrategyProperty

标识 XYFocusLeftNavigationStrategy 依赖属性。

XYFocusRightNavigationStrategy

获取或设置一个值,该值指定用于确定右侧导航的目标元素的策略。

XYFocusRightNavigationStrategyProperty

标识 XYFocusRightNavigationStrategy 依赖属性。

XYFocusUpNavigationStrategy

获取或设置一个值,该值指定用于确定向上导航的目标元素的策略。

XYFocusUpNavigationStrategyProperty

标识 XYFocusUpNavigationStrategy 依赖属性。

方法

AddHandler(RoutedEvent, Object, Boolean)

为指定的路由事件添加路由事件处理程序,并将该处理程序添加到当前元素的处理程序集合中。 将 handledEventsToo 指定为 true 以调用提供的处理程序,即使在其他位置处理事件也是如此。

Arrange(Rect)

定位子对象并确定 UIElement 的大小。 为其子元素实现自定义布局的父对象应从其布局重写实现中调用此方法,以形成递归布局更新。

CancelDirectManipulations()

取消正在进行的直接操作处理, (系统定义的平移/缩放) 包含当前 UIElement 的任何 ScrollViewer 父级。

CapturePointer(Pointer)

将指针捕获设置为 UIElement。 捕获后,只有具有捕获的元素才会触发与指针相关的事件。

ClearValue(DependencyProperty)

清除依赖属性的本地值。

(继承自 DependencyObject)
FindSubElementsForTouchTargeting(Point, Rect)

使 UIElement 子类能够公开有助于解析触摸目标的子元素。

GetAnimationBaseValue(DependencyProperty)

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

(继承自 DependencyObject)
GetChildrenInTabFocusOrder()

允许 UIElement 子类公开参与 Tab 焦点的子元素。

GetValue(DependencyProperty)

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

(继承自 DependencyObject)
InvalidateArrange()

使 UIElement 的排列状态 (布局) 无效。 无效后, UIElement 将更新其布局,这将异步发生。

InvalidateMeasure()

使 UIElement 的度量状态 (布局) 无效。

Measure(Size)

汇报 UIElementDesiredSize。 通常,为其布局子级实现自定义布局的对象从其自己的 MeasureOverride 实现中调用此方法,以形成递归布局更新。

OnBringIntoViewRequested(BringIntoViewRequestedEventArgs)

BringIntoViewRequested 事件发生之前调用。

OnCreateAutomationPeer()

在派生类中实现时,为 Microsoft UI 自动化基础结构返回特定于类的 AutomationPeer 实现。

OnDisconnectVisualChildren()

重写此方法以实现从特定于类的内容或子属性中删除项时布局和逻辑的行为方式。

OnKeyboardAcceleratorInvoked(KeyboardAcceleratorInvokedEventArgs)

在应用中处理 键盘快捷方式 (或快捷键) 时调用。 重写此方法以处理调用键盘快捷键时应用响应的方式。

OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

在应用中处理 键盘快捷方式 (或快捷键) 之前调用。 每当应用程序代码或内部进程调用 ProcessKeyboardAccelerators 时调用。 重写此方法以影响默认加速器处理。

PopulatePropertyInfo(String, AnimationPropertyInfo)

定义可进行动画处理的属性。

PopulatePropertyInfoOverride(String, AnimationPropertyInfo)

在派生类中重写时,定义可进行动画处理的属性。

ReadLocalValue(DependencyProperty)

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

(继承自 DependencyObject)
RegisterAsScrollPort(UIElement)

将元素注册为表示可滚动视区。

RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

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

(继承自 DependencyObject)
ReleasePointerCapture(Pointer)

释放指针捕获,以便通过此 UIElement 捕获一个特定指针。

ReleasePointerCaptures()

释放此元素持有的所有指针捕获。

RemoveHandler(RoutedEvent, Object)

从此 UIElement 中删除指定的路由事件处理程序。 通常,有问题的处理程序是由 AddHandler 添加的。

SetValue(DependencyProperty, Object)

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

(继承自 DependencyObject)
StartAnimation(ICompositionAnimationBase)

开始元素上的指定动画。

StartBringIntoView()

向 XAML 框架发起请求,以将元素引入其包含的任何可滚动区域内的视图。

StartBringIntoView(BringIntoViewOptions)

启动对 XAML 框架的请求,以使用指定的选项将元素引入视图。

StartDragAsync(PointerPoint)

启动拖放操作。

StopAnimation(ICompositionAnimationBase)

停止元素上的指定动画。

TransformToVisual(UIElement)

返回一个转换对象,该对象可用于将 坐标从 UIElement 转换为指定对象。

TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

尝试通过搜索 UIElement 的整个可视化树来 (或快捷键) 调用键盘快捷方式。

TryStartDirectManipulation(Pointer)

在包含当前 UIElement 的任何 ScrollViewer 父级上恢复直接操作处理 (系统定义的平移/缩放) 。

UnregisterPropertyChangedCallback(DependencyProperty, Int64)

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

(继承自 DependencyObject)
UpdateLayout()

确保针对布局正确更新 UIElement 的子对象的所有位置。

事件

AccessKeyDisplayDismissed

在不应再显示访问密钥时发生。

AccessKeyDisplayRequested

当用户请求显示访问密钥时发生。

AccessKeyInvoked

当用户完成访问密钥序列时发生。

BringIntoViewRequested

在此元素或其后代之一上调用 StartBringIntoView 时发生。

CharacterReceived

输入队列接收到单个组合字符时发生。

ContextCanceled

当上下文输入手势继续转换为操作手势时发生,以通知元素不应打开上下文浮出控件。

ContextRequested

当用户完成上下文输入手势(例如右键单击)时发生。

DoubleTapped

当此元素的命中测试区域发生其他未经处理的 DoubleTap 交互时发生。

DragEnter

当输入系统报告具有此元素作为目标的基础拖动事件时发生。

DragLeave

当输入系统报告具有此元素作为原点的基础拖动事件时发生。

DragOver

在输入系统报告出现以此元素为可能放置目标的基础拖动事件时发生。

DragStarting

在启动拖动操作时发生。

Drop

在输入系统报告出现将此元素作为放置目标的基础放置事件时发生。

DropCompleted

结束此元素作为源的拖放操作时发生。

GettingFocus

UIElement 接收焦点之前发生。 此事件是同步引发的,以确保在事件冒泡时不会移动焦点。

GotFocus

UIElement 收到焦点时发生。 此事件是异步引发的,因此焦点可以在浮升完成之前再次移动。

Holding

当此元素的命中测试区域发生其他未处理的 保持 交互时发生。

KeyDown

UIElement 具有焦点时按下键盘键时发生。

KeyUp

UIElement 具有焦点时释放键盘键时发生。

LosingFocus

UIElement 失去焦点之前发生。 此事件是同步引发的,以确保在事件冒泡时不会移动焦点。

LostFocus

UIElement 失去焦点时发生。 此事件以异步方式引发,因此焦点可以在冒泡完成之前再次移动。

ManipulationCompleted

UIElement 上的操作完成时发生。

ManipulationDelta

当输入设备在操作期间更改位置时发生。

ManipulationInertiaStarting

在输入设备在操作期间与 UIElement 对象失去联系和延迟开始时发生。

ManipulationStarted

在输入设备在 UIElement 上开始操作时发生。

ManipulationStarting

在首次创建操作处理器时发生。

NoFocusCandidateFound

当用户尝试通过制表键或方向箭头 (移动焦点) ,但焦点不会移动时发生,因为移动方向上找不到焦点候选项。

PointerCanceled

当进行接触的指针异常失去接触时发生。

PointerCaptureLost

当此元素以前持有的指针捕获移动到另一个元素或其他位置时发生。

PointerEntered

当指针进入此元素的命中测试区域时发生。

PointerExited

当指针离开此元素的命中测试区域时发生。

PointerMoved

当指针在指针停留在此元素的命中测试区域内时移动时发生。

PointerPressed

当指针设备在此元素中启动 Press 操作时发生。

PointerReleased

在释放之前启动 按下 操作的指针设备时发生,同时在此元素中。 请注意, 不保证按下 操作的结尾会触发 PointerReleased 事件;可能会触发其他事件。 有关详细信息,请参阅备注。

PointerWheelChanged

在指针滚轮的增量值更改时发生。

PreviewKeyDown

UIElement 具有焦点时按下键盘键时发生。

PreviewKeyUp

UIElement 具有焦点时释放键盘键时发生。

ProcessKeyboardAccelerators

按下 键盘快捷方式 (或快捷键) 时发生。

RightTapped

当指针位于 元素上时发生右点击输入刺激时发生。

Tapped

在此元素的命中测试区域上发生未经处理的 点击 交互时发生。

适用于

另请参阅