using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using System;
using 常用工具集.Base;

namespace 常用工具集.ViewModels
{
    public class ApplicationViewModel : ViewModelBase
    {
        public DelegateCommand ExitCommand { get; set; }
        public ApplicationViewModel()
        {
            ExitCommand = new DelegateCommand(Exit);
        }

        private void Exit(object obj)
        {
            if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            {
                Environment.Exit(0);
                //desktop.Shutdown();
            }
        }
    }
}
