C# 如何获取WPF中内置路由事件的列表

C# 如何获取WPF中内置路由事件的列表,c#,.net,wpf,events,xaml,C#,.net,Wpf,Events,Xaml,我刚开始使用WPF,需要一些关于路由事件的帮助。我添加了一个带有一些动画的datagrid,但是我似乎找不到任何地方显示要在datagrid上使用的路由事件列表,或者任何其他控件。到目前为止,这似乎是一个猜测游戏 我原以为datagrid标准事件(如CellEditEnding)就是这样,但它们并不像它所说的“无效事件名称”那样 我复制的示例使用了MouseEnter routed事件,但我不知道还有什么可供我使用(当然除了我自己的) 提前感谢您的帮助通过查看控件在MSDN上的文档,您可以获

我刚开始使用WPF,需要一些关于路由事件的帮助。我添加了一个带有一些动画的datagrid,但是我似乎找不到任何地方显示要在datagrid上使用的路由事件列表,或者任何其他控件。到目前为止,这似乎是一个猜测游戏

我原以为datagrid标准事件(如CellEditEnding)就是这样,但它们并不像它所说的“无效事件名称”那样

我复制的示例使用了MouseEnter routed事件,但我不知道还有什么可供我使用(当然除了我自己的)



提前感谢您的帮助

通过查看控件在MSDN上的文档,您可以获得控件公开的事件的完整列表。
DataGrid
是一种特殊情况,因为它不是主框架的一部分(目前),仅在WPF工具包中可用。但是,有关于.NET 4.0版本的
DataGrid
的文档,但是我不确定它与控件的Toolkit版本相比如何


如果试图订阅XAML文件中控件本身标记中的事件,Visual Studio应提供intellisense,其中包括控件的属性和事件。

在代码中,调用static EventManager.GetRoutedEvents()方法获取应用程序已注册/可用的路由事件列表。

以下是列表

[0]: {FrameworkElement.RequestBringIntoView}
[1]: {FrameworkElement.SizeChanged}
[2]: {FrameworkElement.Loaded}
[3]: {FrameworkElement.Unloaded}
[4]: {ToolTipService.ToolTipOpening}
[5]: {ToolTipService.ToolTipClosing}
[6]: {ContextMenuService.ContextMenuOpening}
[7]: {ContextMenuService.ContextMenuClosing}
[8]: {Mouse.PreviewMouseDown}
[9]: {Mouse.MouseDown}
[10]: {Mouse.PreviewMouseUp}
[11]: {Mouse.MouseUp}
[12]: {UIElement.PreviewMouseLeftButtonDown}
[13]: {UIElement.MouseLeftButtonDown}
[14]: {UIElement.PreviewMouseLeftButtonUp}
[15]: {UIElement.MouseLeftButtonUp}
[16]: {UIElement.PreviewMouseRightButtonDown}
[17]: {UIElement.MouseRightButtonDown}
[18]: {UIElement.PreviewMouseRightButtonUp}
[19]: {UIElement.MouseRightButtonUp}
[20]: {Mouse.PreviewMouseMove}
[21]: {Mouse.MouseMove}
[22]: {Mouse.PreviewMouseWheel}
[23]: {Mouse.MouseWheel}
[24]: {Mouse.MouseEnter}
[25]: {Mouse.MouseLeave}
[26]: {Mouse.GotMouseCapture}
[27]: {Mouse.LostMouseCapture}
[28]: {Mouse.QueryCursor}
[29]: {Stylus.PreviewStylusDown}
[30]: {Stylus.StylusDown}
[31]: {Stylus.PreviewStylusUp}
[32]: {Stylus.StylusUp}
[33]: {Stylus.PreviewStylusMove}
[34]: {Stylus.StylusMove}
[35]: {Stylus.PreviewStylusInAirMove}
[36]: {Stylus.StylusInAirMove}
[37]: {Stylus.StylusEnter}
[38]: {Stylus.StylusLeave}
[39]: {Stylus.PreviewStylusInRange}
[40]: {Stylus.StylusInRange}
[41]: {Stylus.PreviewStylusOutOfRange}
[42]: {Stylus.StylusOutOfRange}
[43]: {Stylus.PreviewStylusSystemGesture}
[44]: {Stylus.StylusSystemGesture}
[45]: {Stylus.GotStylusCapture}
[46]: {Stylus.LostStylusCapture}
[47]: {Stylus.StylusButtonDown}
[48]: {Stylus.StylusButtonUp}
[49]: {Stylus.PreviewStylusButtonDown}
[50]: {Stylus.PreviewStylusButtonUp}
[51]: {Keyboard.PreviewKeyDown}
[52]: {Keyboard.KeyDown}
[53]: {Keyboard.PreviewKeyUp}
[54]: {Keyboard.KeyUp}
[55]: {Keyboard.PreviewGotKeyboardFocus}
[56]: {Keyboard.GotKeyboardFocus}
[57]: {Keyboard.PreviewLostKeyboardFocus}
[58]: {Keyboard.LostKeyboardFocus}
[59]: {TextCompositionManager.PreviewTextInput}
[60]: {TextCompositionManager.TextInput}
[61]: {DragDrop.PreviewQueryContinueDrag}
[62]: {DragDrop.QueryContinueDrag}
[63]: {DragDrop.PreviewGiveFeedback}
[64]: {DragDrop.GiveFeedback}
[65]: {DragDrop.PreviewDragEnter}
[66]: {DragDrop.DragEnter}
[67]: {DragDrop.PreviewDragOver}
[68]: {DragDrop.DragOver}
[69]: {DragDrop.PreviewDragLeave}
[70]: {DragDrop.DragLeave}
[71]: {DragDrop.PreviewDrop}
[72]: {DragDrop.Drop}
[73]: {Touch.PreviewTouchDown}
[74]: {Touch.TouchDown}
[75]: {Touch.PreviewTouchMove}
[76]: {Touch.TouchMove}
[77]: {Touch.PreviewTouchUp}
[78]: {Touch.TouchUp}
[79]: {Touch.GotTouchCapture}
[80]: {Touch.LostTouchCapture}
[81]: {Touch.TouchEnter}
[82]: {Touch.TouchLeave}
[83]: {FocusManager.GotFocus}
[84]: {FocusManager.LostFocus}
[85]: {ManipulationDevice.ManipulationStarting}
[86]: {ManipulationDevice.ManipulationStarted}
[87]: {ManipulationDevice.ManipulationDelta}
[88]: {ManipulationDevice.ManipulationInertiaStarting}
[89]: {ManipulationDevice.ManipulationBoundaryFeedback}
[90]: {ManipulationDevice.ManipulationCompleted}
[91]: {Control.PreviewMouseDoubleClick}
[92]: {Control.MouseDoubleClick}
[93]: {ScrollViewer.ScrollChanged}
[94]: {ScrollBar.Scroll}
[95]: {Thumb.DragStarted}
[96]: {Thumb.DragDelta}
[97]: {Thumb.DragCompleted}
[98]: {RangeBase.ValueChanged}
[99]: {TextBoxBase.TextChanged}
[0]: {FrameworkElement.RequestBringIntoView}
[1]: {FrameworkElement.SizeChanged}
[2]: {FrameworkElement.Loaded}
[3]: {FrameworkElement.Unloaded}
[4]: {ToolTipService.ToolTipOpening}
[5]: {ToolTipService.ToolTipClosing}
[6]: {ContextMenuService.ContextMenuOpening}
[7]: {ContextMenuService.ContextMenuClosing}
[8]: {Mouse.PreviewMouseDown}
[9]: {Mouse.MouseDown}
[10]: {Mouse.PreviewMouseUp}
[11]: {Mouse.MouseUp}
[12]: {UIElement.PreviewMouseLeftButtonDown}
[13]: {UIElement.MouseLeftButtonDown}
[14]: {UIElement.PreviewMouseLeftButtonUp}
[15]: {UIElement.MouseLeftButtonUp}
[16]: {UIElement.PreviewMouseRightButtonDown}
[17]: {UIElement.MouseRightButtonDown}
[18]: {UIElement.PreviewMouseRightButtonUp}
[19]: {UIElement.MouseRightButtonUp}
[20]: {Mouse.PreviewMouseMove}
[21]: {Mouse.MouseMove}
[22]: {Mouse.PreviewMouseWheel}
[23]: {Mouse.MouseWheel}
[24]: {Mouse.MouseEnter}
[25]: {Mouse.MouseLeave}
[26]: {Mouse.GotMouseCapture}
[27]: {Mouse.LostMouseCapture}
[28]: {Mouse.QueryCursor}
[29]: {Stylus.PreviewStylusDown}
[30]: {Stylus.StylusDown}
[31]: {Stylus.PreviewStylusUp}
[32]: {Stylus.StylusUp}
[33]: {Stylus.PreviewStylusMove}
[34]: {Stylus.StylusMove}
[35]: {Stylus.PreviewStylusInAirMove}
[36]: {Stylus.StylusInAirMove}
[37]: {Stylus.StylusEnter}
[38]: {Stylus.StylusLeave}
[39]: {Stylus.PreviewStylusInRange}
[40]: {Stylus.StylusInRange}
[41]: {Stylus.PreviewStylusOutOfRange}
[42]: {Stylus.StylusOutOfRange}
[43]: {Stylus.PreviewStylusSystemGesture}
[44]: {Stylus.StylusSystemGesture}
[45]: {Stylus.GotStylusCapture}
[46]: {Stylus.LostStylusCapture}
[47]: {Stylus.StylusButtonDown}
[48]: {Stylus.StylusButtonUp}
[49]: {Stylus.PreviewStylusButtonDown}
[50]: {Stylus.PreviewStylusButtonUp}
[51]: {Keyboard.PreviewKeyDown}
[52]: {Keyboard.KeyDown}
[53]: {Keyboard.PreviewKeyUp}
[54]: {Keyboard.KeyUp}
[55]: {Keyboard.PreviewGotKeyboardFocus}
[56]: {Keyboard.GotKeyboardFocus}
[57]: {Keyboard.PreviewLostKeyboardFocus}
[58]: {Keyboard.LostKeyboardFocus}
[59]: {TextCompositionManager.PreviewTextInput}
[60]: {TextCompositionManager.TextInput}
[61]: {DragDrop.PreviewQueryContinueDrag}
[62]: {DragDrop.QueryContinueDrag}
[63]: {DragDrop.PreviewGiveFeedback}
[64]: {DragDrop.GiveFeedback}
[65]: {DragDrop.PreviewDragEnter}
[66]: {DragDrop.DragEnter}
[67]: {DragDrop.PreviewDragOver}
[68]: {DragDrop.DragOver}
[69]: {DragDrop.PreviewDragLeave}
[70]: {DragDrop.DragLeave}
[71]: {DragDrop.PreviewDrop}
[72]: {DragDrop.Drop}
[73]: {Touch.PreviewTouchDown}
[74]: {Touch.TouchDown}
[75]: {Touch.PreviewTouchMove}
[76]: {Touch.TouchMove}
[77]: {Touch.PreviewTouchUp}
[78]: {Touch.TouchUp}
[79]: {Touch.GotTouchCapture}
[80]: {Touch.LostTouchCapture}
[81]: {Touch.TouchEnter}
[82]: {Touch.TouchLeave}
[83]: {FocusManager.GotFocus}
[84]: {FocusManager.LostFocus}
[85]: {ManipulationDevice.ManipulationStarting}
[86]: {ManipulationDevice.ManipulationStarted}
[87]: {ManipulationDevice.ManipulationDelta}
[88]: {ManipulationDevice.ManipulationInertiaStarting}
[89]: {ManipulationDevice.ManipulationBoundaryFeedback}
[90]: {ManipulationDevice.ManipulationCompleted}
[91]: {Control.PreviewMouseDoubleClick}
[92]: {Control.MouseDoubleClick}
[93]: {ScrollViewer.ScrollChanged}
[94]: {ScrollBar.Scroll}
[95]: {Thumb.DragStarted}
[96]: {Thumb.DragDelta}
[97]: {Thumb.DragCompleted}
[98]: {RangeBase.ValueChanged}
[99]: {TextBoxBase.TextChanged}