UIElement3D 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
UIElement3D 是基于 Windows Presentation Foundation (WPF) 元素和基本呈现特征构建的 WPF 核心级别实现的基类。
public ref class UIElement3D abstract : System::Windows::Media::Media3D::Visual3D, System::Windows::IInputElement
public abstract class UIElement3D : System.Windows.Media.Media3D.Visual3D, System.Windows.IInputElement
type UIElement3D = class
inherit Visual3D
interface IInputElement
Public MustInherit Class UIElement3D
Inherits Visual3D
Implements IInputElement
- 继承
- 派生
- 实现
示例
以下示例演示如何从 UIElement3D 类派生以创建 Sphere 类:
public class Sphere : UIElement3D
{
// OnUpdateModel is called in response to InvalidateModel and provides
// a place to set the Visual3DModel property.
//
// Setting Visual3DModel does not provide parenting information, which
// is needed for data binding, styling, and other features. Similarly, creating render data
// in 2-D does not provide the connections either.
//
// To get around this, we create a Model dependency property which
// sets this value. The Model DP then causes the correct connections to occur
// and the above features to work correctly.
//
// In this update model we retessellate the sphere based on the current
// dependency property values, and then set it as the model. The brush
// color is blue by default, but the code can easily be updated to let
// this be set by the user.
protected override void OnUpdateModel()
{
GeometryModel3D model = new GeometryModel3D();
model.Geometry = Tessellate(ThetaDiv, PhiDiv, Radius);
model.Material = new DiffuseMaterial(System.Windows.Media.Brushes.Blue);
Model = model;
}
// The Model property for the sphere
private static readonly DependencyProperty ModelProperty =
DependencyProperty.Register("Model",
typeof(Model3D),
typeof(Sphere),
new PropertyMetadata(ModelPropertyChanged));
private static void ModelPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Sphere s = (Sphere)d;
s.Visual3DModel = s.Model;
}
private Model3D Model
{
get
{
return (Model3D)GetValue(ModelProperty);
}
set
{
SetValue(ModelProperty, value);
}
}
// The number of divisions to make in the theta direction on the sphere
public static readonly DependencyProperty ThetaDivProperty =
DependencyProperty.Register("ThetaDiv",
typeof(int),
typeof(Sphere),
new PropertyMetadata(15, ThetaDivPropertyChanged));
private static void ThetaDivPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Sphere s = (Sphere)d;
s.InvalidateModel();
}
public int ThetaDiv
{
get
{
return (int)GetValue(ThetaDivProperty);
}
set
{
SetValue(ThetaDivProperty, value);
}
}
// The number of divisions to make in the phi direction on the sphere
public static readonly DependencyProperty PhiDivProperty =
DependencyProperty.Register("PhiDiv",
typeof(int),
typeof(Sphere),
new PropertyMetadata(15, PhiDivPropertyChanged));
private static void PhiDivPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Sphere s = (Sphere)d;
s.InvalidateModel();
}
public int PhiDiv
{
get
{
return (int)GetValue(PhiDivProperty);
}
set
{
SetValue(PhiDivProperty, value);
}
}
// The radius of the sphere
public static readonly DependencyProperty RadiusProperty =
DependencyProperty.Register("Radius",
typeof(double),
typeof(Sphere),
new PropertyMetadata(1.0, RadiusPropertyChanged));
private static void RadiusPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Sphere s = (Sphere)d;
s.InvalidateModel();
}
public double Radius
{
get
{
return (double)GetValue(RadiusProperty);
}
set
{
SetValue(RadiusProperty, value);
}
}
// Private helper methods
private static Point3D GetPosition(double theta, double phi, double radius)
{
double x = radius * Math.Sin(theta) * Math.Sin(phi);
double y = radius * Math.Cos(phi);
double z = radius * Math.Cos(theta) * Math.Sin(phi);
return new Point3D(x, y, z);
}
private static Vector3D GetNormal(double theta, double phi)
{
return (Vector3D)GetPosition(theta, phi, 1.0);
}
private static double DegToRad(double degrees)
{
return (degrees / 180.0) * Math.PI;
}
private static System.Windows.Point GetTextureCoordinate(double theta, double phi)
{
System.Windows.Point p = new System.Windows.Point(theta / (2 * Math.PI),
phi / (Math.PI));
return p;
}
// Tesselates the sphere and returns a MeshGeometry3D representing the
// tessellation based on the given parameters
internal static MeshGeometry3D Tessellate(int tDiv, int pDiv, double radius)
{
double dt = DegToRad(360.0) / tDiv;
double dp = DegToRad(180.0) / pDiv;
MeshGeometry3D mesh = new MeshGeometry3D();
for (int pi = 0; pi <= pDiv; pi++)
{
double phi = pi * dp;
for (int ti = 0; ti <= tDiv; ti++)
{
// we want to start the mesh on the x axis
double theta = ti * dt;
mesh.Positions.Add(GetPosition(theta, phi, radius));
mesh.Normals.Add(GetNormal(theta, phi));
mesh.TextureCoordinates.Add(GetTextureCoordinate(theta, phi));
}
}
for (int pi = 0; pi < pDiv; pi++)
{
for (int ti = 0; ti < tDiv; ti++)
{
int x0 = ti;
int x1 = (ti + 1);
int y0 = pi * (tDiv + 1);
int y1 = (pi + 1) * (tDiv + 1);
mesh.TriangleIndices.Add(x0 + y0);
mesh.TriangleIndices.Add(x0 + y1);
mesh.TriangleIndices.Add(x1 + y0);
mesh.TriangleIndices.Add(x1 + y0);
mesh.TriangleIndices.Add(x0 + y1);
mesh.TriangleIndices.Add(x1 + y1);
}
}
mesh.Freeze();
return mesh;
}
}
Public Class Sphere
Inherits UIElement3D
' OnUpdateModel is called in response to InvalidateModel and provides
' a place to set the Visual3DModel property.
'
' Setting Visual3DModel does not provide parenting information, which
' is needed for data binding, styling, and other features. Similarly, creating render data
' in 2-D does not provide the connections either.
'
' To get around this, we create a Model dependency property which
' sets this value. The Model DP then causes the correct connections to occur
' and the above features to work correctly.
'
' In this update model we retessellate the sphere based on the current
' dependency property values, and then set it as the model. The brush
' color is blue by default, but the code can easily be updated to let
' this be set by the user.
Protected Overrides Sub OnUpdateModel()
Dim model As New GeometryModel3D()
model.Geometry = Tessellate(ThetaDiv, PhiDiv, Radius)
model.Material = New DiffuseMaterial(System.Windows.Media.Brushes.Blue)
Me.Model = model
End Sub
' The Model property for the sphere
Private Shared ReadOnly ModelProperty As DependencyProperty = DependencyProperty.Register("Model", GetType(Model3D), GetType(Sphere), New PropertyMetadata(AddressOf ModelPropertyChanged))
Private Shared Sub ModelPropertyChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
Dim s As Sphere = CType(d, Sphere)
s.Visual3DModel = s.Model
End Sub
Private Property Model() As Model3D
Get
Return CType(GetValue(ModelProperty), Model3D)
End Get
Set(ByVal value As Model3D)
SetValue(ModelProperty, value)
End Set
End Property
' The number of divisions to make in the theta direction on the sphere
Public Shared ReadOnly ThetaDivProperty As DependencyProperty = DependencyProperty.Register("ThetaDiv", GetType(Integer), GetType(Sphere), New PropertyMetadata(15, AddressOf ThetaDivPropertyChanged))
Private Shared Sub ThetaDivPropertyChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
Dim s As Sphere = CType(d, Sphere)
s.InvalidateModel()
End Sub
Public Property ThetaDiv() As Integer
Get
Return CInt(GetValue(ThetaDivProperty))
End Get
Set(ByVal value As Integer)
SetValue(ThetaDivProperty, value)
End Set
End Property
' The number of divisions to make in the phi direction on the sphere
Public Shared ReadOnly PhiDivProperty As DependencyProperty = DependencyProperty.Register("PhiDiv", GetType(Integer), GetType(Sphere), New PropertyMetadata(15, AddressOf PhiDivPropertyChanged))
Private Shared Sub PhiDivPropertyChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
Dim s As Sphere = CType(d, Sphere)
s.InvalidateModel()
End Sub
Public Property PhiDiv() As Integer
Get
Return CInt(GetValue(PhiDivProperty))
End Get
Set(ByVal value As Integer)
SetValue(PhiDivProperty, value)
End Set
End Property
' The radius of the sphere
Public Shared ReadOnly RadiusProperty As DependencyProperty = DependencyProperty.Register("Radius", GetType(Double), GetType(Sphere), New PropertyMetadata(1.0, AddressOf RadiusPropertyChanged))
Private Shared Sub RadiusPropertyChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
Dim s As Sphere = CType(d, Sphere)
s.InvalidateModel()
End Sub
Public Property Radius() As Double
Get
Return CDbl(GetValue(RadiusProperty))
End Get
Set(ByVal value As Double)
SetValue(RadiusProperty, value)
End Set
End Property
' Private helper methods
Private Shared Function GetPosition(ByVal theta As Double, ByVal phi As Double, ByVal radius As Double) As Point3D
Dim x As Double = radius * Math.Sin(theta) * Math.Sin(phi)
Dim y As Double = radius * Math.Cos(phi)
Dim z As Double = radius * Math.Cos(theta) * Math.Sin(phi)
Return New Point3D(x, y, z)
End Function
Private Shared Function GetNormal(ByVal theta As Double, ByVal phi As Double) As Vector3D
Return CType(GetPosition(theta, phi, 1.0), Vector3D)
End Function
Private Shared Function DegToRad(ByVal degrees As Double) As Double
Return (degrees / 180.0) * Math.PI
End Function
Private Shared Function GetTextureCoordinate(ByVal theta As Double, ByVal phi As Double) As System.Windows.Point
Dim p As New System.Windows.Point(theta / (2 * Math.PI), phi / (Math.PI))
Return p
End Function
' Tesselates the sphere and returns a MeshGeometry3D representing the
' tessellation based on the given parameters
Friend Shared Function Tessellate(ByVal tDiv As Integer, ByVal pDiv As Integer, ByVal radius As Double) As MeshGeometry3D
Dim dt As Double = DegToRad(360.0) / tDiv
Dim dp As Double = DegToRad(180.0) / pDiv
Dim mesh As New MeshGeometry3D()
For pi As Integer = 0 To pDiv
Dim phi As Double = pi * dp
For ti As Integer = 0 To tDiv
' we want to start the mesh on the x axis
Dim theta As Double = ti * dt
mesh.Positions.Add(GetPosition(theta, phi, radius))
mesh.Normals.Add(GetNormal(theta, phi))
mesh.TextureCoordinates.Add(GetTextureCoordinate(theta, phi))
Next ti
Next pi
For pi As Integer = 0 To pDiv - 1
For ti As Integer = 0 To tDiv - 1
Dim x0 As Integer = ti
Dim x1 As Integer = (ti + 1)
Dim y0 As Integer = pi * (tDiv + 1)
Dim y1 As Integer = (pi + 1) * (tDiv + 1)
mesh.TriangleIndices.Add(x0 + y0)
mesh.TriangleIndices.Add(x0 + y1)
mesh.TriangleIndices.Add(x1 + y0)
mesh.TriangleIndices.Add(x1 + y0)
mesh.TriangleIndices.Add(x0 + y1)
mesh.TriangleIndices.Add(x1 + y1)
Next ti
Next pi
mesh.Freeze()
Return mesh
End Function
End Class
注解
UIElement3D 是一个抽象基类,可以从中派生类来表示特定的 3D 元素。
类中 UIElement3D 定义了 3D 元素的大部分输入、聚焦和事件行为。 这包括键盘、鼠标和触笔输入和相关状态属性的事件。 其中许多事件都是路由事件,许多与输入相关的事件既具有浮泡路由版本,也有事件的隧道版本。 这些配对事件通常是控制作者最感兴趣的事件。
UIElement3D还包括与WPF事件模型相关的 API,包括可以引发来自元素实例的指定路由事件的方法。
A UIElement3D 具有以下由类专门定义的 UIElement3D 功能:
- 可以响应用户输入(包括控制通过处理事件路由或命令路由发送输入的位置)。
- 可以引发通过逻辑元素树传递路由的路由事件。
Important
Visibility 状态会影响该元素的所有输入处理。 不可见的元素不参与命中测试,并且不接收输入事件,即使鼠标位于元素的边界上(如果可见)。
与 UIElement 类不同,该 UIElement3D 类不包含布局。 因此,该 UIElement3D 类不包括 Measure 或 Arrange 方法。
一个通过重写UIElement3DVisual3D派生GetVisual3DChild并维护其自己的对象集合的Visual3DChildrenCount类,并且仍必须将新Visual3D对象AddVisual3DChild传递给 。
.NET Framework 版本 3.5 中引入了 UIElement3D。 有关详细信息,请参阅 版本和依赖项。
构造函数
| 名称 | 说明 |
|---|---|
| UIElement3D() |
初始化 UIElement3D 类的新实例。 |
字段
属性
| 名称 | 说明 |
|---|---|
| AllowDrop |
获取或设置一个值,该值指示此元素是否可以用作拖放操作的目标。 |
| AreAnyTouchesCaptured |
获取一个值,该值指示是否至少捕获到此元素的一个触摸。 |
| AreAnyTouchesCapturedWithin |
获取一个值,该值指示是否至少捕获一个触摸到此元素或其可视化树中的任何子元素。 |
| AreAnyTouchesDirectlyOver |
获取一个值,该值指示是否在此元素上按下至少一次触摸。 |
| AreAnyTouchesOver |
获取一个值,该值指示是否在该元素或其可视化树中的任何子元素上按下至少一个触摸。 |
| CommandBindings |
获取与此元素关联的对象的集合 CommandBinding 。 |
| DependencyObjectType |
获取包装 DependencyObjectType 此实例的 CLR 类型。 (继承自 DependencyObject) |
| Dispatcher |
获取与此DispatcherDispatcherObject关联的值。 (继承自 DispatcherObject) |
| Focusable |
获取或设置一个值,该值指示元素是否可以接收焦点。 |
| HasAnimatedProperties |
获取一个值,该值指示这 Visual3D 是否具有任何动画属性。 (继承自 Visual3D) |
| InputBindings |
获取与此元素关联的输入绑定的集合。 |
| IsEnabled |
获取或设置一个值,该值指示是否在用户界面(UI)中启用此元素。 |
| IsEnabledCore |
获取一个值,该值将成为派生类中的返回值 IsEnabled 。 |
| IsFocused |
获取一个值,该值确定此元素是否具有逻辑焦点。 |
| IsHitTestVisible |
获取或设置一个值,该值声明此元素是否可以作为其呈现内容的某些部分的命中测试结果返回。 |
| IsInputMethodEnabled |
获取一个值,该值指示是否启用输入法系统(如输入法编辑器(IME)来处理此元素的输入。 |
| IsKeyboardFocused |
获取一个值,该值指示此元素是否具有键盘焦点。 |
| IsKeyboardFocusWithin |
获取一个值,该值指示键盘焦点是元素或其可视化树子元素中的任意位置。 |
| IsMouseCaptured |
获取一个值,该值指示是否将鼠标捕获到此元素。 |
| IsMouseCaptureWithin |
获取一个值,该值确定鼠标捕获是由此元素还是由其可视化树中的子元素保存。 |
| IsMouseDirectlyOver |
获取一个值,该值指示鼠标指针的位置是否对应于命中测试结果,这将考虑元素组合。 |
| IsMouseOver |
获取一个值,该值指示鼠标指针是否位于此元素上(包括可视化树中的子元素)。 |
| IsSealed |
获取一个值,该值指示此实例当前是否密封(只读)。 (继承自 DependencyObject) |
| IsStylusCaptured |
获取一个值,该值指示触笔是否由此元素捕获。 |
| IsStylusCaptureWithin |
获取一个值,该值确定触笔捕获是由此元素保留的,还是由元素边界及其可视化树中的元素保存。 |
| IsStylusDirectlyOver |
获取一个值,该值指示触笔位置是否对应于命中测试结果,这将考虑元素组合。 |
| IsStylusOver |
获取一个值,该值指示触笔游标是否位于此元素上(包括可视子元素)。 |
| IsVisible |
获取一个值,该值指示此元素是否在用户界面(UI)中可见。 |
| TouchesCaptured |
获取捕获到此元素的所有触摸设备。 |
| TouchesCapturedWithin |
获取捕获到此元素的所有触摸设备或其可视化树中的任何子元素。 |
| TouchesDirectlyOver |
获取此元素上的所有触摸设备。 |
| TouchesOver |
获取位于此元素上的所有触摸设备或其可视化树中的任何子元素。 |
| Transform |
获取或设置应用于三维对象的转换。 (继承自 Visual3D) |
| Visibility |
获取或设置此元素的用户界面(UI)可见性。 |
| Visual3DChildrenCount |
获取对象的子元素 Visual3D 数。 (继承自 Visual3D) |
| Visual3DModel |
获取或设置 Model3D 要呈现的对象。 (继承自 Visual3D) |
方法
事件
| 名称 | 说明 |
|---|---|
| DragEnter |
当输入系统将具有此元素的基础拖动事件报告为拖动目标时发生。 |
| DragLeave |
当输入系统报告具有此元素作为拖动原点的基础拖动事件时发生。 |
| DragOver |
当输入系统将具有此元素的基础拖动事件报告为潜在放置目标时发生。 |
| Drop |
当输入系统将此元素作为放置目标报告基础删除事件时发生。 |
| FocusableChanged |
当 Focusable 属性的值更改时发生。 |
| GiveFeedback |
当输入系统报告涉及此元素的基础拖放事件时发生。 |
| GotFocus |
当此元素获得逻辑焦点时发生。 |
| GotKeyboardFocus |
当键盘聚焦在此元素上时发生。 |
| GotMouseCapture |
当此元素捕获鼠标时发生。 |
| GotStylusCapture |
当此元素捕获触笔时发生。 |
| GotTouchCapture |
在捕获到此元素的触摸时发生。 |
| IsEnabledChanged |
当此元素上的 IsEnabled 属性值更改时发生。 |
| IsHitTestVisibleChanged |
当依赖属性的值 IsHitTestVisible 在此元素上更改时发生。 |
| IsKeyboardFocusedChanged |
当此属性的值 IsKeyboardFocused 在此元素上更改时发生。 |
| IsKeyboardFocusWithinChanged |
当此属性的值 IsKeyboardFocusWithin 在此元素上更改时发生。 |
| IsMouseCapturedChanged |
当此属性的值 IsMouseCaptured 在此元素上更改时发生。 |
| IsMouseCaptureWithinChanged |
当此属性的值 IsMouseCaptureWithin 在此元素上更改时发生。 |
| IsMouseDirectlyOverChanged |
当此属性的值 IsMouseDirectlyOver 在此元素上更改时发生。 |
| IsStylusCapturedChanged |
当此属性的值 IsStylusCaptured 在此元素上更改时发生。 |
| IsStylusCaptureWithinChanged |
当此属性的值 IsStylusCaptureWithin 在此元素上更改时发生。 |
| IsStylusDirectlyOverChanged |
当此属性的值 IsStylusDirectlyOver 在此元素上更改时发生。 |
| IsVisibleChanged |
当此属性的值 IsVisible 在此元素上更改时发生。 |
| KeyDown |
当键盘将焦点放在此元素上时按下键时发生。 |
| KeyUp |
当键盘焦点位于此元素上时释放键时发生。 |
| LostFocus |
当此元素失去逻辑焦点时发生。 |
| LostKeyboardFocus |
当键盘不再专注于此元素时发生。 |
| LostMouseCapture |
当此元素丢失鼠标捕获时发生。 |
| LostStylusCapture |
当此元素丢失触笔捕获时发生。 |
| LostTouchCapture |
当此元素丢失触摸捕获时发生。 |
| MouseDown |
当指针位于此元素上时按下任何鼠标按钮时发生。 |
| MouseEnter |
当鼠标指针进入此元素的边界时发生。 |
| MouseLeave |
当鼠标指针离开此元素的边界时发生。 |
| MouseLeftButtonDown |
当鼠标指针位于此元素上时按下鼠标左键时发生。 |
| MouseLeftButtonUp |
当鼠标指针位于此元素上时释放鼠标左键时发生。 |
| MouseMove |
当鼠标指针在此元素上移动时发生。 |
| MouseRightButtonDown |
当鼠标指针位于此元素上时按下鼠标右键时发生。 |
| MouseRightButtonUp |
当鼠标指针位于此元素上时释放鼠标右键时发生。 |
| MouseUp |
在此元素上释放任何鼠标按钮时发生。 |
| MouseWheel |
当用户在鼠标指针位于此元素上时旋转鼠标滚轮时发生。 |
| PreviewDragEnter |
当输入系统将具有此元素的基础拖动事件报告为拖动目标时发生。 |
| PreviewDragLeave |
当输入系统报告具有此元素作为拖动原点的基础拖动事件时发生。 |
| PreviewDragOver |
当输入系统将具有此元素的基础拖动事件报告为潜在放置目标时发生。 |
| PreviewDrop |
当输入系统将此元素作为放置目标报告基础删除事件时发生。 |
| PreviewGiveFeedback |
在启动拖放操作时发生。 |
| PreviewGotKeyboardFocus |
当键盘聚焦在此元素上时发生。 |
| PreviewKeyDown |
当键盘将焦点放在此元素上时按下键时发生。 |
| PreviewKeyUp |
当键盘焦点位于此元素上时释放键时发生。 |
| PreviewLostKeyboardFocus |
当键盘不再专注于此元素时发生。 |
| PreviewMouseDown |
当指针位于此元素上时按下任何鼠标按钮时发生。 |
| PreviewMouseLeftButtonDown |
当鼠标指针位于此元素上时按下鼠标左键时发生。 |
| PreviewMouseLeftButtonUp |
当鼠标指针位于此元素上时释放鼠标左键时发生。 |
| PreviewMouseMove |
当鼠标指针位于此元素上时鼠标指针移动时发生。 |
| PreviewMouseRightButtonDown |
当鼠标指针位于此元素上时按下鼠标右键时发生。 |
| PreviewMouseRightButtonUp |
当鼠标指针位于此元素上时释放鼠标右键时发生。 |
| PreviewMouseUp |
当鼠标指针位于此元素上时释放任何鼠标按钮时发生。 |
| PreviewMouseWheel |
当用户在鼠标指针位于此元素上时旋转鼠标滚轮时发生。 |
| PreviewQueryContinueDrag |
在拖放操作期间键盘或鼠标按钮状态发生更改时发生。 |
| PreviewStylusButtonDown |
当指针位于此元素上时按下触笔按钮时发生。 |
| PreviewStylusButtonUp |
当指针位于此元素上时释放触笔按钮时发生。 |
| PreviewStylusDown |
当触笔位于此元素上时触摸数字化器时发生。 |
| PreviewStylusInAirMove |
当触笔在元素上移动而不实际触摸数字化器时发生。 |
| PreviewStylusInRange |
当触笔足够接近数字化器以检测到时发生,同时在该元素上。 |
| PreviewStylusMove |
触笔在元素上移动时发生。 数字化器检测到触笔时必须移动以引发此事件,否则 PreviewStylusInAirMove 将引发此事件。 |
| PreviewStylusOutOfRange |
当触笔离数字化器太远而无法检测到时发生。 |
| PreviewStylusSystemGesture |
当用户执行多个触笔手势之一时发生。 |
| PreviewStylusUp |
当用户在触笔位于此元素上时将触笔从数字化器上引发触笔时发生。 |
| PreviewTextInput |
当此元素以独立于设备的方式获取文本时发生。 |
| PreviewTouchDown |
当手指触摸屏幕时手指位于此元素上时发生。 |
| PreviewTouchMove |
当手指位于此元素上时,手指在屏幕上移动时发生。 |
| PreviewTouchUp |
当手指位于此元素上时,手指从屏幕上抬起时发生。 |
| QueryContinueDrag |
在拖放操作期间键盘或鼠标按钮状态发生更改时发生。 |
| QueryCursor |
当请求显示游标时发生。 每次鼠标指针移动到新位置时,都会对元素引发此事件,这意味着光标对象可能需要根据其新位置进行更改。 |
| StylusButtonDown |
当指针位于此元素上时按下触笔按钮时发生。 |
| StylusButtonUp |
当指针位于此元素上时释放触笔按钮时发生。 |
| StylusDown |
触笔触摸数字化器时,触笔位于此元素上时发生。 |
| StylusEnter |
当触笔进入此元素的边界时发生。 |
| StylusInAirMove |
当触笔在元素上移动而不实际触摸数字化器时发生。 |
| StylusInRange |
当触笔足够接近数字化器以检测到时发生,同时在该元素上。 |
| StylusLeave |
当触笔离开元素的边界时发生。 |
| StylusMove |
当触笔移到此元素上时发生。 触笔必须在数字化器上移动才能引发此事件。 否则, StylusInAirMove 将改为引发。 |
| StylusOutOfRange |
当触笔离数字化器太远而无法检测到时发生,同时在该元素上。 |
| StylusSystemGesture |
当用户执行多个触笔手势之一时发生。 |
| StylusUp |
当用户在此元素上时将触笔从数字化器上引发触笔时发生。 |
| TextInput |
当此元素以独立于设备的方式获取文本时发生。 |
| TouchDown |
当手指触摸屏幕时手指位于此元素上时发生。 |
| TouchEnter |
当触摸从外部移动到此元素的边界内时发生。 |
| TouchLeave |
当触摸从内到此元素边界外移动时发生。 |
| TouchMove |
当手指位于此元素上时,手指在屏幕上移动时发生。 |
| TouchUp |
当手指位于此元素上时,手指从屏幕上抬起时发生。 |