public Attempter(LoginDialogPresenter presenter) { dispatcher = Dispatcher.CurrentDispatcher; thread = new Thread(a => { try { while (true) { Thread.Sleep(presenter.Delay); dispatcher.Invoke(new Action(() => { if (!disposed) { presenter.Tick(); } })); if (disposed) break; } } catch (Exception ex) { Logger.LogError(ex); } }); thread.Start(); }