Silverlight and Monotouch with Flickr.Net

The Flickr.Net library has been getting a bit of love recently.

Monotouch

Firstly, it got mentioned on the dotnetrocks podcast a week or so ago, a talk with Chris Hardy about Monotouch.

Postcast: http://www.dotnetrocks.com/default.aspx?showNum=568 – Flickr.Net is mentioned about 31minutes in. You can also view Chris’s talk at the NDC conference here: http://streaming.ndc2010.no/tcs/?id=815EADB7-066D-4516-A70F-31EEFDFB1DE2 – he does a demo using the Flickr.Net library in Monotouch at about the 40minutes mark.

Follow chris on twitter here: http://twitter.com/chrisntr

Silverlight

Recently I’ve been trying to work out how best to convert the Flickr.Net library over to Silverlight. Unfortunately it’s not as easy as it sounds, because most of the methods the library uses to talk to Flickr are only available in their asynchronous versions in Silverlight, which means the entire stack has to be converted to an asynchronous pattern.

Anyway, I’m almost there in terms of deciding on a method to use (maybe that is worth another post later) but in the mean time there is a post on the Silverlight Show web site about using Silverlight and Flickr which I’m using as my inspiration – the sooner the article is out of date the better :)

http://www.silverlightshow.net/items/Uploading-and-geo-tagging-photos-on-Flickr-using-Silverlight-4-s-HttpWebRequest.aspx

2 Replies to “Silverlight and Monotouch with Flickr.Net”

  1. Sam,

    I have been playing with Flickr.NET and trying to adopt it to Silverlight. Unfortunately I have not had that much time, so I only translated the methods I needed for my pet project.

    Since most of your business classes use XmlReader, it was easy to convert them to Silverlight. The challenge was the async communication.

    The approach I took was to have methods that accept a callback delegate, some optional user tag and, also optionally, the Dispatcher should the user desire to auto-switch to the GUI thread. The optional parameters of C# 4.0 work out nicely, but the same effect could be achieved by having multiple methods.

    The lambdas and closures make writing async code a bit easier.

    Take a look at this shared 7-zip file and let me know if this has any future. We could perhaps use it in your library.

    http://dl.dropbox.com/u/113012/Flipm.FlickrNet.7z

    Cheers,

    – Filip.

  2. Thanks.

    I’ve actually had some luck myself. I’m not going to use C# 4.0 as I want the library to be compatible with .Net 2.0.

    I also pass a callback delegate, or actually an Action instance, so is likely to be much the same as you have there.

Leave a Reply to Filip Fracz Cancel reply

Your email address will not be published. Required fields are marked *