I am working with an API that has some methods that are called asynchronously with an event procedure upon completion. I can execute the methods, but the event procedure does not seem to fire. NOTE: I posted a similar question yesterday but didn't post the code until much later. I'm hoping someone can spot where I am going wrong
public partial class Window1 : Window
{
ClientAppServer newServer= new ClientAppServer();
public Window1()
{
InitializeComponent();
//the event thats supposed to fire
newServer.ReceiveRequest += ReadServerReply;
}
private void ReadServerReply(RemoteRequest rr)
{
//this point is never reached
MessageBox.Show("reading server reply");
if ((rr.TransferObject) is Gateways)
{
MessageBox.Show("you have gateways!");
}
}
private void login()
{
//API docs says this is an asynchronous call
newServer.RetrieveCollection(typeof(Gateways), true);
}
private void button1_Click(object sender, RoutedEventArgs e)
{
this.login();
}