Mix for Students: facebook development on .NET

I did a session on facebook development using the facebook developer toolkit where I also showed how I integrated my Piss Off Silverlight application into a facebook app, which I now call PissBook. I’ve registered the pissbook url but have yet to point it to my app as it seems that facebook isn’t allowing me to save it as “addable” on facebook 😦  I forgot to put in the post add URL ^_^

 image

What I did was take this silverlight app:

image

And showed how you can make it work with data from facebook (or any other datasource for that matter). If you are using the default page generated by the Silverlight project, you would have something like:

image

on the Page_Load event, you should then be able to add values from your Request variable, in this case the logged in user name, and the friend’s name which i picked up from facebook’s friend-selector component, and pass these as InitParameters to my Silverlight Application.

image
I then needed to do a bit of tweaking in my App.xaml file on the Application_Startup method where I parsed the initialization Parameters and passed it to the constructor on my Page user control, which is basically my Silverlight application.

image

I then created a new constructor for my Page.xaml, which is more or less the same as the original one, except this accepts some parameters and assigns them to the textboxes in my application:

image

image

A simple application but it basically shows you how you can integrate your Silverlight applications with dynamic datasources through its InitParams property.

 

image

Code and slides are here:

http://cid-bdfb7845c22e26b6.skydrive.live.com/embedrow.aspx/Presentations/Mix%20For%20Students

* NOTE: for some reason, when you’re not logged in, facebook gives a 404 when i try to access the app directly from http://apps.facebook.com/facebooksession I’ll update this as soon as I find out a resolution.

this is apparently a 6-month old bug 😦 http://bugs.developers.facebook.com/show_bug.cgi?id=1406 still unresolved.

Leave a comment