Skip to content

Commit

Permalink
fixc test
Browse files Browse the repository at this point in the history
  • Loading branch information
workgroupengineering committed Apr 8, 2024
1 parent 830f757 commit 50b546d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 0 additions & 5 deletions samples/Sandbox/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Input.TextInput;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Win32.WinRT.Composition;

namespace Sandbox
{
Expand Down
9 changes: 4 additions & 5 deletions tests/Avalonia.Markup.Xaml.UnitTests/Xaml/EventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,20 @@ public void Attached_Event_Is_Assigned2()
}

[Fact]
public void Attached_Event_Ruted_Event_Handler()
public void Attached_Event_Routed_Event_Handler()
{
var xaml = @"<Panel xmlns='https://github.com/avaloniaui' Button.Click='OnClick'><Button/></Panel>";
var target = new MyButton();
var xaml = @"<Panel xmlns='https://github.com/avaloniaui' Button.Click='OnClick'><Button Name='target'/></Panel>";
var host = new MyPanel();
host.Children.Add(target);

AvaloniaRuntimeXamlLoader.Load(xaml, rootInstance: host);

var target = host.FindControl<Button>("target");
target.RaiseEvent(new RoutedEventArgs
{
RoutedEvent = Button.ClickEvent,
});

Assert.True(target.WasTapped);
Assert.True(host.WasClicked);
}

public class MyButton : Button
Expand Down

0 comments on commit 50b546d

Please sign in to comment.