From 09250ec9c4ed78a50fae2143e943bcba85edf0d6 Mon Sep 17 00:00:00 2001 From: Bill Henning Date: Fri, 18 Aug 2023 08:47:04 -0400 Subject: [PATCH 1/2] Updated ToggleSplitButton.IsChecked to bind TwoWay by default, same as ToggleButton. --- src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs b/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs index ff8bd5dc0b9..e6f0abcad09 100644 --- a/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs +++ b/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs @@ -2,6 +2,7 @@ using Avalonia.Controls.Metadata; using Avalonia.Controls.Primitives; +using Avalonia.Data; using Avalonia.Interactivity; using Avalonia.Styling; @@ -36,8 +37,8 @@ public event EventHandler? IsCheckedChanged /// Defines the property. /// public static readonly StyledProperty IsCheckedProperty = - AvaloniaProperty.Register( - nameof(IsChecked)); + AvaloniaProperty.Register(nameof(IsChecked), false, + defaultBindingMode: BindingMode.TwoWay); /// /// Initializes a new instance of the class. From 3dd62bf533289d0ad00d0ae9bb3ab5fb8eb40763 Mon Sep 17 00:00:00 2001 From: Bill Henning Date: Fri, 18 Aug 2023 14:57:27 -0400 Subject: [PATCH 2/2] Updated ToggleSplitButton.IsCheckedProperty definition to be on a single line. --- src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs b/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs index e6f0abcad09..c493445ba14 100644 --- a/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs +++ b/src/Avalonia.Controls/SplitButton/ToggleSplitButton.cs @@ -37,8 +37,7 @@ public event EventHandler? IsCheckedChanged /// Defines the property. /// public static readonly StyledProperty IsCheckedProperty = - AvaloniaProperty.Register(nameof(IsChecked), false, - defaultBindingMode: BindingMode.TwoWay); + AvaloniaProperty.Register(nameof(IsChecked), false, defaultBindingMode: BindingMode.TwoWay); /// /// Initializes a new instance of the class.