Hi I am trying to iterate over a list of custom buttons which I have created. It makes a call to a WCF Service to get some info from the DB.
foreach (LevelButton l in ls)
{
WayFinderDBService.WayFinderDBServiceClient client = new SilverlightNav.WayFinderDBService.WayFinderDBServiceClient();
client.GetLevelDescriptionCompleted += new EventHandler<SilverlightNav.WayFinderDBService.GetLevelDescriptionCompletedEventArgs>(client_GetLevelDescriptionCompleted);
client.GetLevelDescriptionAsync(l.Name);
}
I am wanting to take whatever is returned from client.GetLevelDescriptionAsync(l.Name); and then pass this to the button e.g. l.Text = result;
My problem is passing a reference to the button as an extra parameter to the EventHandler. What is the right way to achieve what I want to do?
Thanks