Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3755480
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:42:19+00:00 2026-05-19T09:42:19+00:00

Been doing quite a bit of silverlight programming lately and loving it but of

  • 0

Been doing quite a bit of silverlight programming lately and loving it but of course silverlight is async so i am forced to setup an event handler to call when the async is complete. This works great of course but i am just getting lots of code… basically 2 methods for everycall that i require to a wcf service. I recently discovered the following

client.LoadClientsCompleted += (sender, e) =>
{
    // My Code
};

client.LoadClientsAsync(clientID);

It seems to work, its using lambdas rather than a physically method. I understand that this doesn’t change the working of the technology and its still async. but it seems to tidy up my code quite a lot.

I would love to hear any comments on weather i should be using this, are there any PROS and CONS using either?

As i say point the event directly at a new method works great as well but technically i have 2 methods for every call i make … The code is growing 🙂

Using the lambda way i at least keep my callback event within my current method although it only fires when complete. It seems to make things easier BUT are there any problems with this method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:42:20+00:00Added an answer on May 19, 2026 at 9:42 am

    One big pro is that lambdas can capture the value of variables from their surroundings:

    client.LoadClientsCompleted += (sender, e) => 
    {
         // My Code 
         // your code can use clientID here
    };
    client.LoadClientsAsync(clientID); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been doing quite a bit of debugging of managed applications lately using both
I've been doing quite a bit of searching, but haven't been able to find
I've been doing quite a bit of simple XML-processing in python and grown to
I'm new to C#/.NET but I've been doing TDD for quite some time now.
I just started doing MVC 4 and I've been enjoying it quite a bit,
I'm a pretty experienced Java programmer that's been doing quite a bit of Win32
I'm just getting to know regular expressions, but after doing quite a bit of
I've been doing some browsing on interactive consoles for programming languages such as: http://tryruby.org/levels/1/challenges/0
I've been doing all people told me to make it works , but there
I've got a bit of an issue and I've been asking regarding it quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.