public static IDisposable BindAutohide( this NotificationWindow window) { var timer = Observable.Timer(TimeSpan.FromSeconds(5)) .SubscribeOn(RxApp.TaskpoolScheduler) .ObserveOn(RxApp.MainThreadScheduler) .Accept(_ => { window.Close(); }); return(new CompositeDisposable( timer, Disposable.Create(window.Close))); }
protected override void HandleClosed() { _current = null; base.HandleClosed(); }