NotificationViewModel.cs 587 B

123456789101112131415161718192021222324
  1. using System.Reactive;
  2. using Avalonia;
  3. using Avalonia.Controls.Notifications;
  4. using ReactiveUI;
  5. namespace ControlCatalog.ViewModels
  6. {
  7. public class NotificationViewModel
  8. {
  9. public NotificationViewModel()
  10. {
  11. OKCommand = ReactiveCommand.Create(() =>
  12. {
  13. Application.Current.MainWindow.LocalNotificationManager.Show("Notification Accepted");
  14. });
  15. }
  16. public string Title { get; set; }
  17. public string Message { get; set; }
  18. public ReactiveCommand<Unit, Unit> OKCommand { get; }
  19. }
  20. }