protected virtual void ThreadStartingWindow(Object Args) { // Create our context, and install it: SynchronizationContext.SetSynchronizationContext( new DispatcherSynchronizationContext( Dispatcher.CurrentDispatcher)); GmailMail item = Args as GmailMail; //Create notif NotificationUC uc = new NotificationUC(); NotificationUCVM vm = new NotificationUCVM(item, _settings.FGColor, _settings.BGColor, item.Pos, _datas.FullCount); uc.DataContext = vm; WindowNotification w = new WindowNotification(uc, _settings.WaitSeconds * 1000); //always same position w.Left = width - w.Width - 10; w.Top = height - w.Height - 10; w.Show(); //To keep alive the window try { Dispatcher.Run(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public NotificationUCVM(GmailMail item, Color fgColor, Color bgColor, int pos, int tot) { Item = item; FGColor = new SolidColorBrush(fgColor); BGColor = new SolidColorBrush(bgColor); NbItem = pos; ItemTot = tot; ActionLink = new DelegateCommand(CanExecuteActionLink, ExecuteActionLink); }
public void Notify(GmailMail item) { lock (QItems) { QItems.Enqueue(item); if (QItems.Count > 0 && !_timer.Enabled) { _timer.Start(); } } }