Due to the way WP7 doesn’t have any support for synchronous web requests, the response from each Dropbox request comes via an event.
A basic example is logging in to get an OAuth token for a user.
// First create a new dropbox client object
WP7Dropbox dropboxClient= new WP7Dropbox(api_key, api_secret);
void GetUserToken(string Username, string Password)
// Then register for the TokenComplete event
dropboxClient.TokenComplete += new WP7Dropbox.token_complete(dropboxTokenComplete);
// Finally, request a token.
void dropboxTokenComplete(Token response)
// I'd recommend saving the user token, since it should never expire, and it makes it more convenient
// The user should be informed of this though
IsolatedStorageSettings.ApplicationSettings["Token"] = response;
// dropboxClient.user has now been set with the user token, and this will be used in all future calls
// WP7Dropbox doesn't cache/store the token in permanent storage (as in, closing and opening will require a new token request
dropboxClient.TokenComplete -= new WP7Dropbox.token_complete(dropboxTokenComplete);
If you've stored the user token, then there's no real reason to not use it to log in in the first place
Token user = (Token)IsolatedStorageSettings.ApplicationSettings["Token"];
dropboxClient = new WP7Dropbox(api_key, api_secret, user);
// Get the username/password