public TrayNotificationBalloon(TrayIcon trayIcon) { InitializeComponent(); _trayIcon = trayIcon; var command = ReactiveCommand.Create(); command.Subscribe(x => _trayIcon.CloseBalloon()); CloseNotificationCommand = command; _closeTimer = new Timer(5000); _closeTimer.Elapsed += OnCloseTimerElapsed; _closeTimer.Start(); }
void OnCloseTimerElapsed(object sender, ElapsedEventArgs e) { _trayIcon.CloseBalloon(); }