From ef74802035fbbc0aa5a96b3891a711e383578055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20S=CC=8Colte=CC=81s?= Date: Mon, 16 May 2022 21:22:17 +0200 Subject: [PATCH] Add RequestBringIntoView property --- src/Avalonia.Controls/Control.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Control.cs b/src/Avalonia.Controls/Control.cs index d6a5fa0727..7011acc3da 100644 --- a/src/Avalonia.Controls/Control.cs +++ b/src/Avalonia.Controls/Control.cs @@ -53,7 +53,7 @@ namespace Avalonia.Controls /// Event raised when an element wishes to be scrolled into view. /// public static readonly RoutedEvent RequestBringIntoViewEvent = - RoutedEvent.Register("RequestBringIntoView", RoutingStrategies.Bubble); + RoutedEvent.Register(nameof(RequestBringIntoView), RoutingStrategies.Bubble); /// /// Provides event data for the event. @@ -126,6 +126,15 @@ namespace Avalonia.Controls set => SetValue(FlowDirectionProperty, value); } + /// + /// Occurs when an element wishes to be scrolled into view. + /// + public event EventHandler? RequestBringIntoView + { + add => AddHandler(RequestBringIntoViewEvent, value); + remove => RemoveHandler(RequestBringIntoViewEvent, value); + } + /// /// Occurs when the user has completed a context input gesture, such as a right-click. ///