fb.Get() doesn't exist?

折月煮酒 提交于 2019-12-06 15:53:38

use fb.GetAsync instead. Window Phone 7 doesn't support synchronous methods.

i highly recommend you to download the source code and checkout the "Samples\CS-WP7.sln" example.

var fb = new FacebookClient(_accessToken);

fb.GetCompleted += (o, args) =>
                       {
                           if (args.Error == null)
                           {
                               var me = (IDictionary<string, object>)args.GetResultData();

                               Dispatcher.BeginInvoke(
                                   () =>
                                   {
                                       FirstName.Text = "First Name: " + me["first_name"];
                                       LastName.Text = "Last Name: " + me["last_name"];
                                   });
                           }
                           else
                           {
                               Dispatcher.BeginInvoke(() => MessageBox.Show(args.Error.Message));
                           }
                       };

fb.GetAsync("me");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!