|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System.Reactive; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Controls.ApplicationLifetimes; |
|
|
|
using Avalonia.Controls.Notifications; |
|
|
|
using Avalonia.Dialogs; |
|
|
|
@ -11,6 +12,8 @@ namespace ControlCatalog.ViewModels |
|
|
|
private IManagedNotificationManager _notificationManager; |
|
|
|
|
|
|
|
private bool _isMenuItemChecked = true; |
|
|
|
private WindowState _windowState; |
|
|
|
private WindowState[] _windowStates; |
|
|
|
|
|
|
|
public MainWindowViewModel(IManagedNotificationManager notificationManager) |
|
|
|
{ |
|
|
|
@ -45,10 +48,32 @@ namespace ControlCatalog.ViewModels |
|
|
|
(App.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).Shutdown(); |
|
|
|
}); |
|
|
|
|
|
|
|
ToggleMenuItemCheckedCommand = ReactiveCommand.Create(() => |
|
|
|
ToggleMenuItemCheckedCommand = ReactiveCommand.Create(() => |
|
|
|
{ |
|
|
|
IsMenuItemChecked = !IsMenuItemChecked; |
|
|
|
}); |
|
|
|
|
|
|
|
WindowState = WindowState.Normal; |
|
|
|
|
|
|
|
WindowStates = new WindowState[] |
|
|
|
{ |
|
|
|
WindowState.Minimized, |
|
|
|
WindowState.Normal, |
|
|
|
WindowState.Maximized, |
|
|
|
WindowState.FullScreen, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
public WindowState WindowState |
|
|
|
{ |
|
|
|
get { return _windowState; } |
|
|
|
set { this.RaiseAndSetIfChanged(ref _windowState, value); } |
|
|
|
} |
|
|
|
|
|
|
|
public WindowState[] WindowStates |
|
|
|
{ |
|
|
|
get { return _windowStates; } |
|
|
|
set { this.RaiseAndSetIfChanged(ref _windowStates, value); } |
|
|
|
} |
|
|
|
|
|
|
|
public IManagedNotificationManager NotificationManager |
|
|
|
|