private void OnNewMessageArrived(object sender, MessageHeaderViewModel newMessageHeaderViewModel) { Dispatcher.Invoke(() => { var balloon = new NewMessageBalloon(newMessageHeaderViewModel); TaskbarIcon tb = Application.Current.Resources["TbIcon"] as TaskbarIcon; if (tb != null) { tb.ShowCustomBalloon(balloon, PopupAnimation.Fade, 10000); } }); }
public List <MessageHeaderViewModel> GetInbox() { var messages = new List <MessageHeaderViewModel>(); for (int i = 0; i < 15; i++) { var headers = pop3Client.GetMessageHeaders(i); var messHeader = new MessageHeaderViewModel { Date = headers[HeaderId.Date], From = headers[HeaderId.From], Title = headers[HeaderId.Subject], Id = i }; messages.Add(messHeader); } return(messages); }
public NewMessageBalloon(MessageHeaderViewModel newMessageHeaderViewModel) { InitializeComponent(); this.DataContext = newMessageHeaderViewModel; }