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,该元素表示绘制 Border 的元素。 可以为此类属性提供任何 UIElement 派生元素,包括定义的自定义控件。

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

UIElement API 和功能

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

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

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

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

手势和操作

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

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

基本外观

可见性不透明度 属性通常用于调整 UI 中元素的外观,尤其是在样式、模板和视觉状态中。 剪辑RenderTransform,以及 转换 属性对于生成交互和 UI 元素的不同外观都很有用。

基本布局

UIElement 类为布局特征提供了一个起点,其属性包括 DesiredSizeArrangeMeasure 方法。 FrameworkElement 增加了更多的布局功能。 有关详细信息,请参阅 使用 XAMLFrameworkElement定义布局。

路由事件

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

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

其他平台支持

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 影子
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

标识 剪辑 依赖属性。

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 的包含区域是否可以返回命中测试的真实值。

IsHitTestVisibleProperty

标识 IsHitTestVisible 依赖属性。

IsHoldingEnabled

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

IsHoldingEnabledProperty

标识 IsHoldingEnabled 依赖属性。

IsRightTapEnabled

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

IsRightTapEnabledProperty

标识 IsRightTapEnabled 依赖属性。

IsTapEnabled

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

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 路由事件的标识符。

Opacity

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

OpacityProperty

标识 IsHitTestVisible 依赖属性。

OpacityTransition

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

PointerCanceledEvent

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

PointerCaptureLostEvent

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

PointerCaptures

获取所有捕获的指针集,这些指针表示为 指针 值。

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

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

Shadow

获取或设置元素强制转换的阴影效果。

ShadowProperty

标识阴影 依赖属性

TabFocusNavigation

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

TabFocusNavigationProperty

标识 TabFocusNavigation 依赖属性。

TappedEvent

获取 点击 路由事件的标识符。

Transform3D

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

Transform3DProperty

标识 Transform3D 依赖属性。

TransformMatrix

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

Transitions

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

TransitionsProperty

标识 依赖属性 转换。

Translation

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

TranslationTransition

获取或设置 Vector3Transition,该 Vector3Transition 对翻译属性的更改进行动画处理。

UIContext

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

UseLayoutRounding

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

UseLayoutRoundingProperty

标识 UseLayoutRounding 依赖属性。

Visibility

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

VisibilityProperty

标识 可见性 依赖属性。

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)

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

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

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

PointerReleased

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

PointerWheelChanged

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

PreviewKeyDown

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

PreviewKeyUp

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

ProcessKeyboardAccelerators

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

RightTapped

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

Tapped

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

适用于

另请参阅