I have a Silverlight class library that references a WCF service, I have a method called StoreNodes() that call the WCF service. like this:
public void StoreNodes()
{
DataServiceClient client = new DataServiceClient();
client.GetNodesForCoreCompleted += client_GetNodesForCoreCompleted;
client.GetNodesForCoreAsync();
}
and another method called BuildAll() like this:
public void BuildAll()
{
StoreNodes();
Method2();
}
My problem is method2() is not a WCF service, and the both StoreNodes and Method2 have some variables in common, these variables get their values in StoreNodes and the second method do some operation on them, anyway, the problem is the methode2 is executed before the first method finishes, so I got the null reference error. How can I make sure that the second method is executed after the service calling is finished?? I hope I made my question clear.