private void UpdateThread() { while (true) { var announcements = BulletinBoardService.GetAnnouncements(); try { Dispatcher.Invoke(() => { foreach (var announcement in announcements) { if (!Announcements.Contains(announcement)) { AddAnnouncement(announcement); } } }); } catch (TaskCanceledException) { break; } Thread.Sleep(1000); } }