Freigeben über


Nobody likes seeing the hourglass... [Keep your application responsive with BackgroundTaskManager on WPF and Silverlight]

**

This blog has moved to a new location and comments have been disabled.

All old posts, new posts, and comments can be found on The blog of dlaa.me.

See you there!

Comments

  • Anonymous
    April 08, 2009
    PingBack from http://blogs.msdn.com/delay/archive/2009/04/08/nobody-likes-seeing-the-hourglass-keep-your-application-responsive-with-backgroundtaskmanager-on-wpf-and-silverlight.aspx

  • Anonymous
    April 08, 2009
    Thank you for submitting this cool story - Trackback from DotNetShoutout

  • Anonymous
    April 08, 2009
    great work....it's a very clean solution.  Thanks for the nice article. --dave

  • Anonymous
    July 13, 2009
    What if an exception is thrown in the background task?

  • Anonymous
    July 14, 2009
    mcnamaragio, The MSDN documentation for the DoWork event describes what happens if an exception is thrown: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.dowork(VS.95).aspx Hope this helps!

  • Anonymous
    July 25, 2009
    Hi, I've been trying to make a reusable background worker close to the one you show here. Your work looks good and I've learn from it, the obvious down-side is that your class is singleton and so can only be one instance in the whole system. You might want to have different section of your system have independent background task management. Also you left out the exception handling. Thank you, Ido.

  • Anonymous
    July 26, 2009
    Thanks for the feedback, Ido! It's always great when people are able to work off of each other's ideas to come up with even better things! :)

  • Anonymous
    August 11, 2010
    Hi, I'm wanting to include a BGThread manager in my VB.net code, and I'm having issues translating your class to VB.Net.. Specifically the following...

  1. public static EventHandler<EventArgs> BackgroundTaskStarted;
  2. var backgroundTaskStartedHandler = BackgroundTaskStarted;        if (null != backgroundTaskStartedHandler)        {            backgroundTaskStartedHandler.Invoke(null, EventArgs.Empty);        } I would appreciate it very much if you could supply a vb.net equivelant..
  • Anonymous
    August 11, 2010
    Grant, I'm on vacation and don't have a compiler available at the moment - however, maybe try something like the following to get started:

Public Shared BackgroundTaskCompleted As EventHandler(Of EventArgs) 2. ' Invoke the BackgroundTaskStarted event Dim backgroundTaskStartedHandler = BackgroundTaskStarted If backgroundTaskStartedHandler IsNot Nothing Then    backgroundTaskStartedHandler.Invoke(Nothing, EventArgs.Empty) End If If that doesn't help, maybe try one of the many VB.NET/C# code translation tools on the web. Thanks!