TextBoxBase.OnQueryContinueDrag(QueryContinueDragEventArgs) 方法


每当未处理的 QueryContinueDrag 附加路由事件在其路由中发生在一个从此类派生的元素上时,就会调用此方法。Invoked whenever an unhandled QueryContinueDrag attached routed event reaches an element derived from this class in its route. 实现此方法可为此事件添加类处理。Implement this method to add class handling for this event.

 override void OnQueryContinueDrag(System::Windows::QueryContinueDragEventArgs ^ e);
protected override void OnQueryContinueDrag (System.Windows.QueryContinueDragEventArgs e);
override this.OnQueryContinueDrag : System.Windows.QueryContinueDragEventArgs -> unit
Protected Overrides Sub OnQueryContinueDrag (e As QueryContinueDragEventArgs)



提供与事件有关的数据。Provides data about the event.


此方法没有默认实现。This method has no default implementation. 如果继承中的中间类实现了此方法, 则仍建议在实现中调用 base ()。Calling base() in your implementation is still recommended, in case an intermediate class in the inheritance implemented this method. 您可以根据自己的要求, 在特殊处理之前或之后调用 base ()。You may call base() either before or after your special handling, depending on your requirements.

此方法的目的有些类似于公共语言运行时 (CLR)common language runtime (CLR) * 方法上的事件模式: 它可让你通过使用类处理程序而不是实例处理程序来处理来自派生类的匹配事件。The purpose of this method is somewhat similar to 公共语言运行时 (CLR)common language runtime (CLR) event pattern On* methods: it lets you handle the matching event from derived classes by using a class handler instead of an instance handler. 在这种情况下, 匹配事件是路由事件。In this case, the matching event is a routed event. 对于路由事件, On * 方法的实现模式是不同的, 因为路由事件可能由子元素引发, 这不一定是调用处理程序的元素。The implementation pattern of the On* methods is different for routed events because the routed event may have been raised by a child element, which is not necessarily the element that invokes handlers. 因此, 您的实现需要考虑事件参数的源属性 (在大多数情况下, 不应尝试重新引发该事件)。Therefore, your implementation needs to take the event arguments' source properties into account (and should not try to re-raise the event in most cases). 在路由TextBoxBase中收到事件时, 的子类可以选择调用私有类处理程序方法。Subclasses of TextBoxBase can choose to call private class handler methods when the event is received along the route. 一种方案是采用事件的参数并将事件标记为 "已处理"。One scenario is to take the arguments of the event and mark the event as handled.