HI Infragistics team :
I am Javier Carreño, from Bogota, Colombia. I am developing a silverlight application with wcf services and I am using xamcalculationmanager and calculationfunctions... Inside CalculationFunction evaluate method I need to get data from database... but, I can get data from wcf in an asynchronous way... so, my question is : How to do that the evaluate-method's thread wait for asynchronous method ends and to retrieve data from database to can use this data on evaluation process ?? I tried so many ways without sucess... Can you help me ?
Thanks a lot,
Javier Carreño
Hello Javier,
Thank you for your post. I have been looking into it and I can suggest you see this links:
http://stackoverflow.com/questions/4047132/how-can-i-wait-for-an-async-wcf-service-to-complete
and
http://msdn.microsoft.com/en-us/library/ms730059.aspx
http://msdn.microsoft.com/en-us/library/ms731177.aspx
where it is explained how to call a WCF asynchronous and add a “completed”/ “ended” event to indicate that the operation is completed. Once you did this you can call the CalcualtionFunction’s Evaluate method this event’s handler. Also, if you have further questions related with WCF I can suggest you ask them in the MSDN forums, since there you can get an answer from and MS expert.
Stefan : Thanks a lot for your response...
However, My question was not answered... I know about how to call a wcfservice in a asynchronous way and I use this in all my silverlightr applications... but, I need now perform some calculations that include to read data from database INSIDE the calculation... My formula not looks as [a] + [b] where [a] and [b] are single named references... my formula loks as : GetDataSavedInDBUsingA([a]) + [b]... I built a CalculationFunction named GetDataSavedInDBUsingA and inside the Evaluate Method I need to throw the async request to DB and RECEIVE the completed event from my wcf service... BUT the completed event returns on a separate Thread, and the behavior that I am got is that the Evaluate method ends before the completed event returns from wcf service and my evaluate function just return a empty (or zero) result...
So, I need a full WCF support INSIDE the calculation function or I will have to rewrite all my formulas without use CalculationFunctions... and I hope that the Infragistics team experts can help me...
Best regards,
Javier