private void ShowNewsDetail(NewsDTO newsObj, string title) { var window = new NewsDetailWindow(); window.Title = title + newsObj.PublishDate + " " + newsObj.Headline; window.Closed += (s, a) => { NewsTicker.NewsStoryBoard.Resume(); }; NewsTicker.Cursor = Cursors.Wait; window.Cursor = Cursors.Wait; window.Show(); _data.GetNewsDetailAsync(newsObj.StoryId, detail => Dispatcher.BeginInvoke( () => { NewsTicker.Cursor = Cursors.Arrow; window.Cursor = Cursors.Arrow; window.Content.Text = detail.Story; }), ReportException); }
void ShowAlert(NewsDTO news, string keyword) { var title = string.Format("Alert ({0}): ", keyword); Dispatcher.BeginInvoke(() => ShowNewsDetail(news, title)); }