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);
         }
     });
 }
Esempio n. 2
0
        private bool MessageFilter(object item)
        {
            // Do not display any messages when no mailbox is selected.
            if (CurrentMailbox == null)
            {
                return(false);
            }

            MessageHeaderViewModel messageVm = item as MessageHeaderViewModel;
            bool showMsg = false;

            if (messageVm.AccountName == CurrentMailbox.AccountName &&
                messageVm.MailboxPath == CurrentMailbox.DirectoryPath)
            {
                showMsg = true;
            }

            return(showMsg);
        }
 public NewMessageBalloon(MessageHeaderViewModel newMessageHeaderViewModel)
 {
     InitializeComponent();
     this.DataContext = newMessageHeaderViewModel;
 }