|
|
|
@ -2,6 +2,7 @@ |
|
|
|
using System.Windows.Input; |
|
|
|
using Avalonia.Data; |
|
|
|
using Avalonia.Input; |
|
|
|
using Avalonia.Interactivity; |
|
|
|
using Avalonia.Media; |
|
|
|
using Avalonia.Platform; |
|
|
|
using Avalonia.Rendering; |
|
|
|
@ -271,6 +272,19 @@ namespace Avalonia.Controls.UnitTests |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Button_Invokes_CanExecute_When_CommandParameter_Changed() |
|
|
|
{ |
|
|
|
var target = new Button(); |
|
|
|
var raised = 0; |
|
|
|
|
|
|
|
target.Click += (s, e) => ++raised; |
|
|
|
|
|
|
|
target.RaiseEvent(new RoutedEventArgs(AccessKeyHandler.AccessKeyPressedEvent)); |
|
|
|
|
|
|
|
Assert.Equal(1, raised); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Raises_Click_When_AccessKey_Raised() |
|
|
|
{ |
|
|
|
var command = new TestCommand(p => p is bool value && value); |
|
|
|
var target = new Button { Command = command }; |
|
|
|
|