Silverlight Toolkit November 2009: Activity Control –> BusyIndicator (a.k.a. Update 3: Displaying background activity in a Silverlight RIA application)


Wow!  What a week!  PDC, the Silverlight 4 Beta, and now the November 2009 release of the Silverlight Toolkit!  There’s been a ton of great news and exciting announcements, and now I can share with you that the Activity control, first blogged here, is now a part of the Silverlight Toolkit!

Awesome!  What does that mean for the Activity control?

During this transition, the Activity control underwent a few changes (thanks to my colleagues working on the Toolkit – David Anson and Jeff Wilcox) to make it more generally palatable:

  • The control has been renamed from “Activity” to “BusyIndicator” in order to avoid confusion with the concept of an Activity (sounds a lot like “Task”)
    • Similarly, “IsActive” is now “IsBusy”, and the visual states have been renamed appropriately as well.
  • AutoBind and related properties have been removed once and for all.  They were a performance hog in the original versions, and they really only hit a very, very narrow scenario.  Instead, bind to a property that represents your busyness.
  • MinDisplayTime has gone away.  If you’re looking to change the minimum display time, you can re-template the control and add a duration to the transition from visible back to hidden.
  • OverlayBrush and OverlayOpacity have been replaced with a single OverlayStyle property where you can set the color/opacity of the overlay easily.
  • DisplayAfter now defaults to 0.1s instead of 0.05s

Otherwise, the control is basically the same!  Give it a shot!

With this transition, the BusyIndicator control truly becomes accessible to anyone who’s using the Silverlight Toolkit.  You can report bugs through that project on codeplex, and we’ll make sure to keep an eye on any feedback we get from you on the control.

Great… So where can I find it?

It’s simple!  Just download the November 2009 Silverlight Toolkit for either Silverlight 3 or Silverlight 4.  There are a few ways to get it:

The BusyIndicatorControl can be found in the System.Windows.Controls namespace in the System.Windows.Controls.Toolkit.dll assembly in the toolkit.

And… can I see it in action?

Yep!  David Anson created some awesome samples in the Toolkit Sample Browser for the BusyIndicator.  I’m a big fan of his work! :)

BusyIndicator is now in the Silverlight Toolkit sample browser!

I hope you all enjoy using the BusyIndicator control in your applications!  Let me know what you think!

P.S. Thanks to Jeff Wilcox, who beat me to explaining this change :)   I’ve been super-busy with PDC, so it was good to have someone start getting the word out early.  Jeff gives a great overview of what the control is meant to do and has lots of resources regarding the Silverlight Toolkit.  Check out his blog!

, , , , ,

  1. #1 by Michel Miranda on November 21, 2009 - 11:43 pm

    Great control! I have two questions.
    1. I want to show the busy indicator but keep the content enabled. Is it possible?
    2. I want to show a custom animation. How to get rid of the gray background rectangle?
    Thanks in advance.

  2. #2 by Maca on November 24, 2009 - 7:04 pm

    I just installed the toolkit and tried to use in an existing solution. I was trying to drag the BusyIndicator from the toolbox into the xaml and got the following error:

    The operation could not be completed.

    I got it working by removing the reference to System.Windows.Controls.Toolkit and readding it.

    Looking forward to use it now. :)

  3. #3 by Nk54 on November 25, 2009 - 8:09 am

    Lol this morning all my activity control makes page unavailable on blend :/

    so i google “davidpoll” and surprise ! your activityControll become busyIndicator in the new toolkit :D

    Ctrl+H replace “activityControll” to “BusyIndicator” all work finally fine ^^

    thx ! nice job (also to Jeff and David)

  4. #4 by david.poll on November 29, 2009 - 8:25 am

    Hi folks! I’ve been on vacation for the last week (immediately following PDC). I’ll try to address your questions/comments in the next few days. Thanks for all the feedback!

  5. #5 by AC van Bers on December 7, 2009 - 11:33 pm

    Super that the control is now integrated in the toolkit!

    1 problem I’m experiencing though:
    It breaks buttons when the ICommand interface is used in SL4 beta..

    I made a post and tracking about it:

    http://forums.silverlight.net/forums/p/146909/327160.aspx#327160

    http://silverlight.codeplex.com/WorkItem/View.aspx?WorkItemId=4754

    • #6 by david.poll on December 8, 2009 - 12:00 am

      Thanks for reporting this issue! It sounds like a bug in the logic for enabling/disabling when the button is bound to an ICommand. I’ll look into it.

  6. #7 by Simon on December 18, 2009 - 3:44 am

    Setting IsBusy=true will immediately put up the gray background – even if the actual dialog box hasn’t appeared yet.

    This is quite annoying if the component you’re updating is being updated via a timer because it will then flicker on the triggering of the timer.

    If the gray background would not appear until the box itself appears then that would be great!

    If you’re using busy indicator as a safeguard for a slow internet connection, where normally the call should return instantly this is quite an annoying limitation.

    • #8 by david.poll on December 21, 2009 - 3:30 pm

      You can actually turn this off quite easily — those behaviors are part of the template for the control (managed by the VisualStateManager). Use Blend to create a new template that doesn’t show the background.

      If I remember correctly, though, I don’t put the gray background up immediately — all I’m doing is disabling the underlying controls (which turns most of them gray) by disabling their container. Again, this is behavior you can change easily by retemplating.

  7. #9 by Muaz Zubair on February 25, 2010 - 4:18 am

    Excellent post!
    I get great experience through your blogs.
    Sometimes I get unexpected problems when I working with Silverlight. I want to contact some expert programmer, but I didn’t know anyone. Please, can you let me ask these type question directly (through e-mail).
    I want to learn from your experience.

(will not be published)