diff --git a/src/Avalonia.Controls/ItemsControl.cs b/src/Avalonia.Controls/ItemsControl.cs index 366c145356..f7fbf8112d 100644 --- a/src/Avalonia.Controls/ItemsControl.cs +++ b/src/Avalonia.Controls/ItemsControl.cs @@ -298,6 +298,18 @@ namespace Avalonia.Controls /// public IEnumerable GetRealizedContainers() => Presenter?.GetRealizedContainers() ?? Array.Empty(); + /// + /// Scrolls the specified item into view. + /// + /// The index of the item. + public void ScrollIntoView(int index) => Presenter?.ScrollIntoView(index); + + /// + /// Scrolls the specified item into view. + /// + /// The item. + public void ScrollIntoView(object item) => ScrollIntoView(ItemsView.IndexOf(item)); + /// /// Returns the that owns the specified container control. /// diff --git a/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs b/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs index 6c58044c79..185af1a715 100644 --- a/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs +++ b/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs @@ -409,18 +409,6 @@ namespace Avalonia.Controls.Primitives EndUpdating(); } - /// - /// Scrolls the specified item into view. - /// - /// The index of the item. - public void ScrollIntoView(int index) => Presenter?.ScrollIntoView(index); - - /// - /// Scrolls the specified item into view. - /// - /// The item. - public void ScrollIntoView(object item) => ScrollIntoView(ItemsView.IndexOf(item)); - /// /// Gets the value of the on the specified control. ///