|
|
@@ -24,25 +24,8 @@ namespace ControlCatalog.ViewModels
|
|
|
private bool _preferSystemChromeEnabled;
|
|
|
private double _titleBarHeight;
|
|
|
|
|
|
- public MainWindowViewModel(IManagedNotificationManager notificationManager)
|
|
|
+ public MainWindowViewModel()
|
|
|
{
|
|
|
- _notificationManager = notificationManager;
|
|
|
-
|
|
|
- ShowCustomManagedNotificationCommand = MiniCommand.Create(() =>
|
|
|
- {
|
|
|
- NotificationManager.Show(new NotificationViewModel(NotificationManager) { Title = "Hey There!", Message = "Did you know that Avalonia now supports Custom In-Window Notifications?" });
|
|
|
- });
|
|
|
-
|
|
|
- ShowManagedNotificationCommand = MiniCommand.Create(() =>
|
|
|
- {
|
|
|
- NotificationManager.Show(new Avalonia.Controls.Notifications.Notification("Welcome", "Avalonia now supports Notifications.", NotificationType.Information));
|
|
|
- });
|
|
|
-
|
|
|
- ShowNativeNotificationCommand = MiniCommand.Create(() =>
|
|
|
- {
|
|
|
- NotificationManager.Show(new Avalonia.Controls.Notifications.Notification("Error", "Native Notifications are not quite ready. Coming soon.", NotificationType.Error));
|
|
|
- });
|
|
|
-
|
|
|
AboutCommand = MiniCommand.CreateFromTask(async () =>
|
|
|
{
|
|
|
var dialog = new AboutAvaloniaDialog();
|
|
|
@@ -52,7 +35,6 @@ namespace ControlCatalog.ViewModels
|
|
|
await dialog.ShowDialog(mainWindow);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
ExitCommand = MiniCommand.Create(() =>
|
|
|
{
|
|
|
(App.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Shutdown();
|
|
|
@@ -143,24 +125,12 @@ namespace ControlCatalog.ViewModels
|
|
|
set { this.RaiseAndSetIfChanged(ref _windowStates, value); }
|
|
|
}
|
|
|
|
|
|
- public IManagedNotificationManager NotificationManager
|
|
|
- {
|
|
|
- get { return _notificationManager; }
|
|
|
- set { this.RaiseAndSetIfChanged(ref _notificationManager, value); }
|
|
|
- }
|
|
|
-
|
|
|
public bool IsMenuItemChecked
|
|
|
{
|
|
|
get { return _isMenuItemChecked; }
|
|
|
set { this.RaiseAndSetIfChanged(ref _isMenuItemChecked, value); }
|
|
|
}
|
|
|
|
|
|
- public MiniCommand ShowCustomManagedNotificationCommand { get; }
|
|
|
-
|
|
|
- public MiniCommand ShowManagedNotificationCommand { get; }
|
|
|
-
|
|
|
- public MiniCommand ShowNativeNotificationCommand { get; }
|
|
|
-
|
|
|
public MiniCommand AboutCommand { get; }
|
|
|
|
|
|
public MiniCommand ExitCommand { get; }
|