Esempio n. 1
0
        private void Populate(string str,int index)
        {
            XDocument xdoc = XDocument.Parse(str);
            System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                foreach (XElement item in xdoc.Root.Element("channel").Elements("item"))
                {
                    DisplayModel dp = new DisplayModel();
                    _DataCollection.ElementAt(index).DataCollection.Add(dp);
                    dp.Title = StringExtensions.Cleanup((string)item.Element("title"));

                    dp.Date = StringExtensions.Cleanup((string)item.Element("pubDate"));
                    dp.Date = dp.Date.Substring(0, dp.Date.Length - 1);
                    dp.Desc = StringExtensions.Cleanup((string)item.Element("description"));
                    dp.Link = StringExtensions.Cleanup((string)item.Element("link"));
                }
            });

            CompletedCount++;
            if (CompletedCount == _DataCollection.Count)
                Completed = true;
        }