From 149a51e366e34d1caf93fc757ae6538ee8998f56 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:39 +0200 Subject: [PATCH] Add IsSelectedChanged property --- .../Primitives/SelectingItemsControl.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs b/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs index a730659330..6a3ac95fca 100644 --- a/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs +++ b/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs @@ -103,7 +103,7 @@ namespace Avalonia.Controls.Primitives /// public static readonly RoutedEvent IsSelectedChangedEvent = RoutedEvent.Register( - "IsSelectedChanged", + nameof(IsSelectedChanged), RoutingStrategies.Bubble); /// @@ -139,6 +139,17 @@ namespace Avalonia.Controls.Primitives IsSelectedChangedEvent.AddClassHandler((x, e) => x.ContainerSelectionChanged(e)); } + /// + /// Event that should be raised by items that implement to + /// notify the parent that their selection state + /// has changed. + /// + public event EventHandler? IsSelectedChanged + { + add { AddHandler(IsSelectedChangedEvent, value); } + remove { RemoveHandler(IsSelectedChangedEvent, value); } + } + /// /// Occurs when the control's selection changes. ///