public void GetFriends() { SocialAccount account = SettingHelper.GetKeyValue <SocialAccount>("SocialAccount"); Uri uri = new Uri(String.Format(EndpointHelper.USER_GET_FRIENDS, account.access_token)); ConstructRequest(uri, "GET", null, "get_friends"); }
void client_GetCompleted(object sender, FacebookApiEventArgs e) { if (e.Error != null) { Dispatcher.BeginInvoke(() => MessageBox.Show(e.Error.Message)); return; } else { //SocialAccount account = new SocialAccount( //var result = (IDictionary<string, object>)e.GetResultData(); //var id = (string)result["id"]; FBUser userAccount = JsonConvert.DeserializeObject<FBUser>(e.GetResultData().ToString()); SocialAccount socialAccount = new SocialAccount(userAccount.id,client.AccessToken,userAccount.username,null); SettingHelper.SetKeyValue<SocialAccount>("SocialAccount",socialAccount); Dispatcher.BeginInvoke(() => { FacebookWebBrowser.Visibility = System.Windows.Visibility.Collapsed; StackPanelHeader.Visibility = System.Windows.Visibility.Visible; ContentPanel.Visibility = System.Windows.Visibility.Visible; }); } }