Today I managed to upload my first Silverlight application that read RSS feed data about articles and news. This application was developed using Microsoft Expression Blend 2 SP1 and Visual Studio 2008 SP1. Due to Silverlight security limitation to access cross domain server, I have to create a proxy server to read the rss feed and push it back to my silverlight application . You can see the live demo here. The RSS feed of course taken from Berita Harian website (www.bharian.com.my). This is just a demo to showcase something what Silverlight can do.
Here is the screenshot :-

The animation takes place when you hover your mouse on the left menus.
Here is the code snippet to call the rss feed :-
void GetFeed()
{
WebClient client = new WebClient();
client.OpenReadCompleted += new OpenReadCompletedEventHandlerclient_OpenReadCompleted);
client.OpenReadAsync(new Uri(LINK));
}
It is recommended that you used OpenRead rather than DownloadString. This method is the Microsoft best practice on how to read xml from URI.
Here is the code snippet to process the result :-
void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
if (e.Error != null)
{
return;
}
try
{
using (Stream s = e.Result)
{
XDocument doc = XDocument.Load(s);
if (doc != null)
{
IEnumerable
select rss;
if (items != null && items.Count
{
spListBox.Children.Clear();
foreach (XElement item in items)
{
FeedData feeditem = new FeedData();
feeditem.txtFeedTitle.Text = item.Element("title").Value;
feeditem.txtSummary.Text = item.Element("description").Value;
feeditem.URL = item.Element("link").Value;
spListBox.Children.Add(feeditem);
}
}
}
}
}
catch (Exception ex)
{
//do something
}
}
Another technology I used to process the result is Linq to XML. You need to add the System.Xml.Linq assembly in your project in order to use this feature.
Currently this application have been published at silverlight.net showcase. To be more specific, in the showcase page, click on the geography menu at the top left corner, then click on the Malaysia flag.
If you guys got any comments, please jot it down.



Hi,your blog is very nice.I like it very much. welcome to my blog !my blog is about Cheap Air Jordan 、Nike Dunk and Silver Tiffany. could you give me some suggestion? i shold thank you very much.
ReplyDelete1、We have excellent customer service team, which could solve online various problems about the Silver Tiffany we provide in 24 hours.
ReplyDelete2、We have perfect Logistics system, which guarantees all the ordered Silver Tiffany are delivered to you in good shape as fast as possible.
3、We have strong manufacture plant, which are able to provide various models, sizes & colors of Silver Tiffany ranging from 1 to 23 according to what you request.
4、We have the first-rate after-sale service , in case that the Silver Tiffanyproducts that you receive come across some quality problems, then, please do not worry, we are abound to refund all the payment in one week. Also, the products can be changed in one me month.The main products we specialize in are showed as follows.
Our Silver Tiffany:
Earring
Necklace
Bangle
Bracelet
Ring
pendant
Elsa Peretti
Return To Tiffany
Tiffany 1837
Paloma Picasso
Atlas
Frank Gehry
Browe Tiffany Notes
browse Siffany Somerset
Browse Tiffany Signature
Etoile
Tiffany Beads
Cushion
awesome..
ReplyDeleteu should try news dashboard kinda stuffss.. with more native language suppout (chinese or tamil newspapers).. sure big hit man!