using System.Windows.Input; using Avalonia.Controls; using Avalonia.Interactivity; using CommunityToolkit.Mvvm.Input; namespace PixiEditor.AvaloniaUI.ViewModels; public static class SystemCommands { public static RoutedEvent CloseWindowEvent { get; } = RoutedEvent.Register(nameof(CloseWindowEvent), RoutingStrategies.Bubble); public static RoutedEvent MaximizeWindowEvent { get; } = RoutedEvent.Register(nameof(MaximizeWindowEvent), RoutingStrategies.Bubble); public static RoutedEvent MinimizeWindowEvent { get; } = RoutedEvent.Register(nameof(MinimizeWindowEvent), RoutingStrategies.Bubble); public static RoutedEvent RestoreWindowEvent { get; } = RoutedEvent.Register(nameof(RestoreWindowEvent), RoutingStrategies.Bubble); public static ICommand CloseWindowCommand { get; } = new RelayCommand(CloseWindow); public static void CloseWindow(Window? obj) { obj?.Close(); } }