I am using : http://www.codeproject.com/KB/IP/Facebook_API.aspx
I am trying to call the xaml which is created using WPF. But it gives me a
The calling thread must be STA, because many UI components require this.
error
I don't know what to do. I am trying to do this:
FacebookApplication.FacebookFriendsList ffl = new FacebookFriendsList();
but it is giving me that error
Edit: added background worker
static BackgroundWorker bw = new BackgroundWorker();
static void Main(string[] args)
{
bw.DoWork += bw_DoWork;
bw.RunWorkerAsync("Message to worker");
Console.ReadLine();
}
static void bw_DoWork(object sender, DoWorkEventArgs e)
{
// This is called on the worker thread
FacebookApplication.FacebookFriendsList ffl = new FacebookFriendsList();
Console.WriteLine(e.Argument); // writes "Message to worker"
// Perform time-consuming task...
}