visual studio 2010 - Make application bar button to log out Facebook-Windows Phone -
i want make 1 of application bar icons/buttons log out button facebook. saw thread: logging out facebook using facebook c# sdk in wp7
this code of button(in app.xaml):
<shell:applicationbariconbutton click="navigationbuttonclick2" iconuri="/assets/appbar/appbar.cancel.rest.png" text="log out" /> this event handler of button(in app.xaml.cs):
private void navigationbuttonclick2(object sender, eventargs e) { facebookclient _fbclient = new facebookclient(fbaccess.accesstoken); var logoutparams = new dictionary<string, object>(); logoutparams.add("next", "https://www.facebook.com/connect/login_success.html"); //logoutparams.add("",) var logouturl = _fbclient.getlogouturl(logoutparams); browsercontrol.navigated += new eventhandler<system.windows.navigation.navigationeventargs>(browsercontrol_navigated); browsercontrol.navigate(new uri(logouturl.absoluteuri)); if (e.uri.absoluteuri == "https://www.facebook.com/connect/login_success.html") { navigationservice.navigate(new uri("/mainpage.xaml", urikind.relative)); } } public eventhandler<navigationeventargs> browsercontrol_navigated { get; set; } public eventhandler<navigationeventargs> browsercontrol { get; set; } } the error in event handler. errors are:
error 1 name 'fbaccess' not exist in current context
error 2 'system.eventhandler' not contain definition 'navigated' , no extension method 'navigated' accepting first argument of type 'system.eventhandler' found (are missing using directive or assembly reference?)
error 3 'system.eventhandler' not contain definition 'navigate' , no extension method 'navigate' accepting first argument of type 'system.eventhandler' found (are missing using directive or assembly reference?)
error 4 'system.eventargs' not contain definition 'uri' , no extension method 'uri' accepting first argument of type 'system.eventargs' found (are missing using directive or assembly reference?)
can please guide me how fix error?
thank you.
Comments
Post a Comment