public NotifyMessageViewModel(NotifyMessage content, AnimatedLocation location, Action closedAction)
 {
     this._content = content;
     this._location = location;
     this._closedAction = closedAction;
 }
        void rssDataDownloaded(object sender, DownloadStringCompletedEventArgs e)
        {
            XmlReader reader = XmlReader.Create(new StringReader(e.Result));
            SyndicationFeed downloadFeed = SyndicationFeed.Load(reader);
            if (downloadFeed != null &&
                downloadFeed.LastUpdatedTime > Settings.Default.lastUpdated)
            {
                // we have a new cheevo!
                var newCheevos =
                    from item in downloadFeed.Items
                    where item.PublishDate > Settings.Default.lastUpdated
                    select item;

                foreach (var cheevo in newCheevos)
                {
                    string name = cheevo.Title.Text;
                    var icon = OfficeCheevosClient.Properties.Resources.cheevo;

                    var msg = new NotifyMessage(
                        DefaultCheevoBackground,
                        name, DefaultCheevoIcon, () => System.Windows.Forms.MessageBox.Show(""));
                    var t = new Thread(() =>
                                       Dispatcher.Invoke(DispatcherPriority.Normal, new Action<NotifyMessage>(AddCheevo), msg));
                    t.Start();
                }
            }

            Settings.Default.lastUpdated = downloadFeed.LastUpdatedTime.DateTime;
            Settings.Default.Save();
        }
 private void AddCheevo(NotifyMessage msg)
 {
     notifyMessageMgr.EnqueueMessage(msg);
 }
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     var msg = new NotifyMessage(DefaultCheevoBackground, "Show popup on screen (100pts)", DefaultCheevoIcon, () => System.Windows.Forms.MessageBox.Show(""));
     notifyMessageMgr.EnqueueMessage(msg);
 }
 public void EnqueueMessage(NotifyMessage msg)
 {
     QueuedMessages.Enqueue(msg);
     Start();
 }