Could you check whether client.GetFooCompleted is null before assigning a
handler to it?


On Sat, Mar 2, 2013 at 3:54 PM, Greg Keogh <[email protected]> wrote:

> Folks, I have some skeleton code like this in a Silverlight app:
>
> client.GetFooCompleted += (s, e) =>
> {
>     Trace("GetFoo result is {0}", e.Result);
> };
> client.GetFooAsync(rowId);
>
> This works fine, but then I noticed that the completion handler code keeps
> getting added on every call and the completion code runs 1, 2, 3, 4, etc
> times.
>
> Is there an elegant way of rejigging  this code to get the correct
> one-call-one-completion behaviour.
>
> Greg
>

Reply via email to