WP7 / Silverlight Social Networking Buttons
A couple of people have asked about the social networking buttons that appear on most of my WP7 apps allowing you to share a link via Twitter / Facebook etc.
As is often the case I spent some time pursuing my own efforts before I stumbled upon a rather easy / nifty / flexible solution involving the API available at http://api.addthis.com.
Essentially this rest based API provides a consistent way to call each Social network, so it is simply a case of creating a HyperlinkButton for each of the providers you wish to support (Its not difficult to consolidate this into a single method that is called by all the buttons, provided you give each button a name that reflects the provider you wish to call).
So each hyperlink button has a click event that calls a method something like:
Notice that the click event code fires before the navigation is fired – very handy!