惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Register - Security
The Register - Security
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
N
Netflix TechBlog - Medium
量子位
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
H
Help Net Security
D
Docker
D
DataBreaches.Net
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
B
Blog
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
The Cloudflare Blog
F
Full Disclosure
GbyAI
GbyAI
F
Fortinet All Blogs
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
Recent Announcements
Recent Announcements
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
博客园 - 叶小钗
小众软件
小众软件
V
Visual Studio Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
J
Java Code Geeks
雷峰网
雷峰网
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Webroot Blog
Webroot Blog
美团技术团队
N
News | PayPal Newsroom
G
Google Developers Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园_首页
V
Vulnerabilities – Threatpost

博客园 - rapid

Rapid Business Development: Lightswitch vs. Dynamics CRM vs. SharePoint 2010 vs. ASP.NET MVC 3 OCS 2007 R2下载资源整理 下载silverlight官网的全部视频 [已修正链接] 让Windows7顺利识别笔记本4G内存 “最郁闷的一次面试经历”勾起我对面试经验的一些看法 OpenSesame示例源码 转:WF中的跟踪服务(1):Sql跟踪数据库表,视图,存储过程等相关说明 转:技巧:使用User Control做HTML生成 转:一点一点学ASP.NET之基础概念——HttpModule Increasing the CRM 4.0 Attachment Size Limit 超级实用且不花哨的js代码大全 (转)编写发布Plug-In 转:汉字转全拼,简拼组件 转:高阶函数、委托与匿名方法 转:.NET平台下Web测试工具横向比较 比较著名的.net技术论坛网址(含国外的) SMO学习笔记(一)——备份篇之完全备份 转:数据库管理对象(SMO)-为什么没有System.Data.DBManagement命名空间? 网站管理模板 stp 安装解决办法
对Scott Gu的Silverlight Sample--DiggSample的修改 - rapid
rapid · 2009-12-12 · via 博客园 - rapid

由于Scott Gu的Sample中的数据已经不能获取,于是花了点时间把数据获取重写了下

仍然是Linq to XML,具体代码如下

XDocument xmlStories = XDocument.Parse(xmlContent);

XNamespace digg = "http://digg.com/docs/diggrss/";

XNamespace media = "http://search.yahoo.com/mrss/";

var stories = from story in xmlStories.Descendants("item")

              where story.Element(media + "thumbnail") != null &&

                    story.Element(media + "thumbnail").Attribute("url") != null &&

                    story.Element(media + "thumbnail").Attribute("url").Value.EndsWith(".jpg")

              select new DiggStory

              {

                  //Id = (int)story.Attribute("id"),

                  Title = ((string)story.Element("title")).Trim(),

                  Description = Regex.Replace(((string)story.Element("description")).Trim(), @"<(.[^>]*)>", "", RegexOptions.IgnoreCase),

                  ThumbNail = (string)story.Element(media + "thumbnail").Attribute("url"),

                  HrefLink = new Uri((string)story.Element("link")),

                  NumDiggs = (int)story.Element(digg + "diggCount"),

                  UserName = (string)story.Element(digg + "submitter").Element(digg + "username"),

              };

 

 还有一个地方,大家在做这个Demo的时候,注意在SL3中已经没有WateredTextBox,新的控件为DataPickerTextBox

 截图如下:

 [代码] 代码下载