diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs index 3a8a721eec..51ca91f5bf 100644 --- a/src/Avalonia.Controls/Window.cs +++ b/src/Avalonia.Controls/Window.cs @@ -172,13 +172,13 @@ namespace Avalonia.Controls /// Routed event that can be used for global tracking of window destruction /// public static readonly RoutedEvent WindowClosedEvent = - RoutedEvent.Register(nameof(WindowClosed), RoutingStrategies.Direct); + RoutedEvent.Register("WindowClosed", RoutingStrategies.Direct); /// /// Routed event that can be used for global tracking of opening windows /// public static readonly RoutedEvent WindowOpenedEvent = - RoutedEvent.Register(nameof(WindowOpened), RoutingStrategies.Direct); + RoutedEvent.Register("WindowOpened", RoutingStrategies.Direct); private readonly NameScope _nameScope = new NameScope(); @@ -445,24 +445,6 @@ namespace Avalonia.Controls } } - /// - /// Routed event that can be used for global tracking of window destruction. - /// - public event EventHandler? WindowClosed - { - add => AddHandler(WindowClosedEvent, value); - remove => RemoveHandler(WindowClosedEvent, value); - } - - /// - /// Routed event that can be used for global tracking of opening windows. - /// - public event EventHandler? WindowOpened - { - add => AddHandler(WindowOpenedEvent, value); - remove => RemoveHandler(WindowOpenedEvent, value); - } - /// /// Starts moving a window with left button being held. Should be called from left mouse button press event handler ///