You can pass in a value for the userToken when you invoke ExecuteAsync. See the reference for details http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Quer...
Yes, you will have access to UserToken in the Completed event. See post# 4 in this thread http://forums.arcgis.com/threads/19810-showing-related-records-in-maptips
IDictionary<string, object> parameters = new Dictionary<string, object>(); parameters["param1"] = 1; parameters["param2"] = "one"; QueryTask qt = new QueryTask(); Query q = new Query(); qt.ExecuteCompleted += (s, e) => { var myParams = e.UserState as IDictionary; var param1 = (int)myParams["param1"]; var param2 = (string)myParams["param2"]; }; qt.ExecuteAsync(q, parameters);
Yes, this is possible with UserTokenIDictionary<string, object> parameters = new Dictionary<string, object>(); parameters["param1"] = 1; parameters["param2"] = "one"; QueryTask qt = new QueryTask(); Query q = new Query(); qt.ExecuteCompleted += (s, e) => { var myParams = e.UserState as IDictionary; var param1 = (int)myParams["param1"]; var param2 = (string)myParams["param2"]; }; qt.ExecuteAsync(q, parameters);
Yes, you will have access to UserToken in the Completed event. See post# 4 in this thread http://forums.arcgis.com/threads/19810-showing-related-records-in-maptips
Is there a way I can pass in my own parameters to QueryTask?
I can have 2 or more QueryTask run asynchronously, and the completed event handler are invoked after each QueryTask is done. I want to pass in a parameter to recognize which QueryTask I'm running. Or is there a flag or property that I can detect?
Thanks!