I want the SaveChanges
of the ObjectContext
(Win apps) to save changes 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?
Warning: The answer below is old and may not apply to the most recent versions of the framework in question.
I believe you need to use Asynchronous Delegates. It basically works like that:
You create a delegate from the method you want to call asynchronously;
You call BeginInvoke
on the delegate, starting a call;
You do whatever else you need to do (e.g. animate a marquee);
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;