c# - No overload for 'ConnectWithFacebook_Click' matches delegate 'System.Windows.RoutedEventHandler' -
first of all, i'd establish i'm extreme n00b @ c#, i'm trying learn of intermediate example.
i found tutorial create facebook application using fb c# sdk @ http://blog.prabir.me/post/facebook-csharp-sdk-writing-your-first-facebook-application-v6.aspx. in tutorial, has used winforms, wanted courageous , made same program wpf.
i face problem see has happened many users, couldn't figure out how can fix code. receive error shown below:
no overload 'connectwithfacebook_click' matches delegate 'system.windows.routedeventhandler'
i don't syntax errors, when start program, error appears (i think that's call runtime error?). double click error, points wpf code.
here's wpf code:
<button x:name="connectwithfacebook" content="connect facebook" horizontalalignment="left" padding="10, 5" margin="520,10,0,0" verticalalignment="top" background="#ff3782dc" foreground="white" borderbrush="{x:null}" fontfamily="segoe wp n light" fontsize="14" height="31" width="159" click="connectwithfacebook_click"/>
here's c# code:
private void connectwithfacebook_click(facebookoauthresult facebookoauthresult) { var fblogindialog = new facebooklogindialog(appid, extendedpermissions); fblogindialog.showdialog(); displayappropriatemessage(fblogindialog.facebookoauthresult); if (facebookoauthresult != null) { if (facebookoauthresult.issuccess) { console.writeline("you have connected facebook account!"); } } }
please me overcome problem, hope me , c# can start beautiful learning experience. thank much.
signature of connectwithfacebook button click event handler incorrect.try this
private void connectwithfacebook_click(object sender, routedeventargs e) { var fblogindialog = new facebooklogindialog(appid, extendedpermissions); fblogindialog.showdialog(); displayappropriatemessage(fblogindialog.facebookoauthresult); if (fblogindialog.facebookoauthresult != null) { if (fblogindialog.facebookoauthresult.issuccess) { console.writeline("you have connected facebook account!"); } } }
Comments
Post a Comment