views:

431

answers:

1

Hi all!

I want the SaveChanges of the ObjectContext (Win apps) to SaveChanges asynchronously, will show a marquee (or controllable?) progress bar (this I can easily implement) for the user while he is able to continue working.

I basically want to override the SaveChanges of the ObjectContext.

Has anyone thought about this before?

+1  A: 

I believe you need to use Asynchronous Delegates. It basically works like that:

  1. You create a delegate from the method you want to call asynchronously;

  2. You call BeginInvoke on the delegate, starting a call;

  3. You do whatever else you need to do (e.g. animate a marquee);

  4. You can either wait for the async call to finish, or check whether is has completed and keep animating the marquee if it isn't;

jpbochi