Browse Source

Add back wanted SplitButton changes after reverting commits

pull/7422/head
robloo 5 years ago
parent
commit
1605d3a702
  1. 4
      src/Avalonia.Controls/SplitButton/SplitButton.cs

4
src/Avalonia.Controls/SplitButton/SplitButton.cs

@ -271,12 +271,12 @@ namespace Avalonia.Controls
if (_isAttachedToLogicalTree)
{
// Must unregister events here while a reference to the old command still exists
if (e.OldValue is ICommand oldCommand)
if (e.OldValue.GetValueOrDefault() is ICommand oldCommand)
{
oldCommand.CanExecuteChanged -= CanExecuteChanged;
}
if (e.NewValue is ICommand newCommand)
if (e.NewValue.GetValueOrDefault() is ICommand newCommand)
{
newCommand.CanExecuteChanged += CanExecuteChanged;
}

Loading…
Cancel
Save