What is the WPF equivalent of Silverlight's ScrollViewer.ScrollIntoView?
What is the WPF equivalent of Silverlight's ScrollViewer.ScrollIntoV开发者_StackOverflowiew?
The FrameworkElement class implements a BringIntoView() method - if you are dealing with a class that inherits from FrameworkElement you should be able to call that method. The method essentially raises the RequestBringIntoViewEvent which will bubble up the visual tree. The ScrollViewer and a bunch of other classes handle the event and then call their internal logic to bring the element into view.
Also some ItemControls such as DataGrid or ListBox provide a ScrollIntoView() method to make a child visible.
The ScrollIntoView() in turns calls the OnBringItemIntoView method in the ItemsControl class and in turn calls the FrameworkElement but also deals with a VirtualizingPanel where you might not have a FrameworkElement already created.
加载中,请稍侯......
精彩评论