@ -5,40 +5,17 @@ using Avalonia.Win32.WinRT.Composition;
namespaceSandbox
{
publicpartialclassMainWindow:Window
publicclassMainWindow:Window
{
publicMainWindow()
{
InitializeComponent();
#if DEBUG
this.InitializeComponent();
this.AttachDevTools();
#endif
}
privatevoidInitializeComponent()
{
AvaloniaXamlLoader.Load(this);
varbutton=newButton
{
Content="Tabulate to this button"
};
Content=button;
button.GotFocus+=(_,_)=>
{
button.IsEnabled=false;
button.Content=
$"Now this button is disabled ({nameof(IsEnabled)}:{button.IsEnabled},{nameof(IsEffectivelyEnabled)}:{button.IsEffectivelyEnabled}), but you can still press Enter";
button.KeyDown+=(_,_)=>
{
button.Content="button got fired by KeyDown event";