RequestBringIntoViewEventHandler 委托

定义

表示将处理 RequestBringIntoView 路由事件的方法。Represents the method that will handle the RequestBringIntoView routed event.

public delegate void RequestBringIntoViewEventHandler(System::Object ^ sender, RequestBringIntoViewEventArgs ^ e);
public delegate void RequestBringIntoViewEventHandler(object sender, RequestBringIntoViewEventArgs e);
type RequestBringIntoViewEventHandler = delegate of obj * RequestBringIntoViewEventArgs -> unit
Public Delegate Sub RequestBringIntoViewEventHandler(sender As Object, e As RequestBringIntoViewEventArgs)

参数

sender
Object

事件处理程序所附加到的对象。The object where the event handler is attached.

e
RequestBringIntoViewEventArgs

事件数据。The event data.

继承
RequestBringIntoViewEventHandler

注解

处理此事件通常只在支持可滚动区域的元素内完成, 或者有意将其呈现大小设置得小于其子元素内容所需的大小, 只需特意处理事件在元素树中向上路由, 并且已到达提供滚动区域支持的第一个父级。Handling this event is typically only done within elements that support a scrollable region, or otherwise deliberately set their rendering size smaller than the combined desired size of their child element content, and is only done by deliberately handling the event once it has routed upwards in the element tree and has reached the first parent that offers scrolling region support. 以用户控件通常需要的方式处理滚动区域的现有实现就是ScrollViewerAn existing implementation that handles scrolling regions in a manner that is typically desirable for user controls is ScrollViewer. 如果派生自ScrollViewer, 则可以为FrameworkElement.RequestBringIntoView注册类处理程序, 并补充事件的基类处理。If you derive from ScrollViewer, you can register a class handler for FrameworkElement.RequestBringIntoView and supplement the base class handling of the event. 还应考虑使用或类处理类定义ScrollChanged的事件, FrameworkElement.RequestBringIntoView而不是。You should also consider using or class-handling the class-defined ScrollChanged event instead of FrameworkElement.RequestBringIntoView. 或者, 如果你创建了一个不是从ScrollViewer派生的完全自定义类, 则仍可以通过在类实例化中调用EventManager.RegisterClassHandler来添加类处理。Alternatively, if you create an entirely custom class that does not derive from ScrollViewer, you can still add class handling by calling EventManager.RegisterClassHandler in your class instantiation. 有关类处理的详细信息, 请参阅将路由事件标记为 "已处理" 和 "类处理"。For details on class handling, see Marking Routed Events as Handled, and Class Handling.

内容元素可能会导致事件由其内容宿主引发 (通过调用BringIntoView内容宿主并从内容主机进行引发FrameworkElement.RequestBringIntoView )。Content elements can cause the event to be raised by their content hosts (through calling BringIntoView and raising FrameworkElement.RequestBringIntoView from the content host). 同样, 可以通过 helper 方法LogicalTreeHelper.BringIntoView请求使逻辑树元素进入视图。Similarly, you can request logical tree elements to be brought into view with the helper method LogicalTreeHelper.BringIntoView.

实现一个相关但不同的方法ScrollIntoViewListBoxA ListBox implements a related but different method ScrollIntoView.

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于

另请参阅