From ee36313c3ecbbec7cf73e981c5cbab10f88bdf78 Mon Sep 17 00:00:00 2001 From: robloo Date: Thu, 27 Jan 2022 11:27:24 -0500 Subject: [PATCH] Revert "Move more Button property changed handling into OnPropertyChanged override" This reverts commit 853d4140a301f09cfa4bc4727c086459de903169. --- src/Avalonia.Controls/Button.cs | 142 +++++++++++------- .../SplitButton/SplitButton.cs | 4 +- 2 files changed, 89 insertions(+), 57 deletions(-) diff --git a/src/Avalonia.Controls/Button.cs b/src/Avalonia.Controls/Button.cs index 3735e6c010..770eb63266 100644 --- a/src/Avalonia.Controls/Button.cs +++ b/src/Avalonia.Controls/Button.cs @@ -59,13 +59,13 @@ namespace Avalonia.Controls AvaloniaProperty.Register(nameof(CommandParameter)); /// - /// Defines the property. + /// Defines the property. /// public static readonly StyledProperty IsDefaultProperty = AvaloniaProperty.Register(nameof(IsDefault)); /// - /// Defines the property. + /// Defines the property. /// public static readonly StyledProperty IsCancelProperty = AvaloniaProperty.Register(nameof(IsCancel)); @@ -98,6 +98,10 @@ namespace Avalonia.Controls static Button() { FocusableProperty.OverrideDefaultValue(typeof(Button), true); + CommandProperty.Changed.Subscribe(CommandChanged); + CommandParameterProperty.Changed.Subscribe(CommandParameterChanged); + IsDefaultProperty.Changed.Subscribe(IsDefaultChanged); + IsCancelProperty.Changed.Subscribe(IsCancelChanged); AccessKeyHandler.AccessKeyPressedEvent.AddClassHandler