1234567891011121314151617181920212223242526 |
- using Avalonia;
- using Avalonia.Controls.ApplicationLifetimes;
- using MiniMvvm;
- namespace ControlCatalog.ViewModels
- {
- public class ApplicationViewModel : ViewModelBase
- {
- public ApplicationViewModel()
- {
- ExitCommand = MiniCommand.Create(() =>
- {
- if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime lifetime)
- {
- lifetime.Shutdown();
- }
- });
- RestoreDefault = MiniCommand.Create(() => { });
- }
- public MiniCommand ExitCommand { get; }
- public MiniCommand RestoreDefault { get; }
- }
- }
|