다음을 통해 공유


Do you know Silverlight has an inbuilt native RSS Reader?

Interesting, I keep asking this question a lot and the responses I get are something that un-nerves me. In that, in Silverlight there is a native RSS Reader built in, so the ability to consume an RSS Feed is so easy, it's almost cheating (Sharepoint readers, pay attention here).

The secret to this can be found in the namespace:

using System.ServiceModel.Syndication;

The class in question is the SyndicationFeed.

Code example of how to use this great API, can be found here:

https://silverlight.net/Quickstarts/Remote/ed86e719-0da0-49e1-a9e1-b31f483070d4.aspx

I personally have been using it with Sharepoint, in that I'm no Sharepoint 2007 guru at all, I've learnt Sharepoint through just goofing around and playing with it. Given that I'm a total newbie to the product, I decided to build out an intranet with Sharepoint, where I'd use Silverlight as the one-stop client, with it's own native forms built within and then simply leverage Sharepoint for the hard stuff (business logic, workflow, document collaboration etc).

The way I did this, was I'd use RSS Feeds (that well basically come free on every Custom List etc you spin up inside Sharepoint) that would help me with my data sets, and it would do in a way that was very automatic. In that, the READ part of my RIA solution is child's play with the above RSS Reader API.

Yet, comes the part on how to Create, Update and Delete. This requires forms right? RSS Reader need not apply here.

That's ok, as what I've done is used a basic iframe, hidden it via CSS and using Silverlight forms, I'd data bind the forms themselves to html forms within the iframe via the HtmlWindow Class (the natural JavaScript way of life in Silverlight, it's free!).

As you can hopefully imagine, I've got the full power of Sharepoint now at my disposal, and Silverlight has such a passive amount of control over it that again, it's almost considered cheating. To the end user, visually it just appears 100% Silverlight and at the same time, I can easily use a hybrid approach (point is, AJAX + Silverlight can be a really good bet here).

That's the reason I think Silverlight is such a powerful runtime that at times we get lost in the whole Flash vs Silverlight battle, and never really sit down and look at what's in front of us.  A great Line of Business RIA solution which can have a passive impact to a solution such as Sharepoint.

Passive being the keyword, in that no need to learn a 3rd party language, keep it .NET, keep it inside Visual Studio, just ship.

You can do this passive approach with any solution as well.

Not convinced? that's ok, i'll blog about this in depth shortly but before I do, what's your thoughts on this approach?

Comments

  • Anonymous
    August 14, 2008
    It's a great API when RSS Feed is used in a application. By the way, it's not coming from Silverlight API, but by core .NET 3.5 API. It's not an inbuilt native for Silverlight.

  • Anonymous
    August 14, 2008
    It's a great API. Agreed on the API front, but I use Silverlight API as a way of conveying it in it's simpliest form. If you say it's a .NET 3.5 standalone it can send out a confusing message that its more a of .NET 3.5 addon vs part of native Silverlight. In the end they all roll up under the one brand. That being said the fact it's .NET 3.5 also conveys the message that you're able to use it in both Silverlight and WPF without changing your approach.

  • Anonymous
    August 14, 2008
    Thanks for highlighting this - but the sample you reference doesn't work with SL 2 Beta 2 because of threading issues - see http://www.itwriting.com/blog/830-silverlight-2-threading-issues-quickstarts-not-working.html Tim

  • Anonymous
    August 14, 2008
    You're right, all comes in one brand, SyndicationFeed can be used both on Silverlight, WPF, and even in WinForms application. I only react on the fact that people can be a little confused, thinking if they want to use this API outside of a Silverlight context, it' won't works. Have a nive day, and thx for all your post.

  • Anonymous
    August 30, 2008
    Tim, The way to get around the threading issue is to use the following: this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() =>                {                    YourControl.Text += "* " + item.Title.Text + Environment.NewLine;                }));

  • Anonymous
    October 20, 2008
    Hello Everyone, Can someone guide me how to read and display a RSS feed in SL 2.0. I have been trying but no win. I would appreciate if some one can guid me with code sample Thanks VF