31

I mentioned that there is no standard busy control in WPF. So what's the easiest way to display animated busy circle (not progress bar) such as your browser displays when loading a page ?

Please if you suggest downloading control from internet make sure that this control is for free and with no licence restriction (such as I would be forced to GPL my application if I use it).

Thank you in advance

Rasto
  • 17,204
  • 47
  • 154
  • 245

6 Answers6

19

There's also Sacha Barber's Circular Progress Bar. It's licensed under the Code Project Open License.

Ondrej Janacek
  • 12,486
  • 14
  • 59
  • 93
dthrasher
  • 40,656
  • 34
  • 113
  • 139
  • 2
    Probably moved to http://www.codeproject.com/Articles/49853/Better-WPF-Circular-Progress-Bar – quetzalcoatl Apr 04 '14 at 19:57
  • 6
    Someone in the comments on that page made a no-code-behind version. it's pretty slick. Direct link: http://fredgrass.blogspot.com/2015/07/wpf-busy-indicator.html – Chris Mar 21 '16 at 20:48
12

BizzySpinner 2 – A WPF Spinning Busy State Indicator (with source)

Nifle
  • 11,745
  • 10
  • 75
  • 100
10

You can also use animated gifs, compare e.g. this site: http://www.loadinfo.net/. Different colors, forms, frames per second, transparant background are generated for you.

Then you add the WPF Animated GIF as a reference to your project.

Make a usercontrol with <Image gif:ImageBehavior.AnimatedSource="Images/animated.gif" /> as its content and give the usercontrol a dependencyproperty (DP) IsBusy with a callback to a method in the usercontrol:

`public static readonly DependencyProperty IsBusyProperty = DependencyProperty.Register("IsBusy", typeof(bool), typeof(SpinProgress), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnIsBusyChangedCallBack)));`

In this method the animated gif's Play() and 'Pause()' methods can be executed.
Bind the usercontrol's IsBusy property to the view-model.

Or - when appropiate - ignore the DP and the Play() and Pause() methods and bind the Visibility property to the view-model.

Gerard
  • 13,023
  • 14
  • 72
  • 125
4

You can implement processing wheel while your application is busy. although WPF do not support any GIF images so you've to use animation for this. below is a good link for FrameAnimation spin wheel.

http://www.codeproject.com/Articles/29545/FrameBasedAnimation-Animating-multiple-properties

Deeps
  • 330
  • 1
  • 5
  • 16
3

I recently uploaded one to codeplex. It allows you to customize it (even in runtime). You can download it from here. Sample demo also uploaded.

Andras Sebo
  • 1,120
  • 8
  • 19
0

I recently implemented one that looks like the iPhone busy indicator, explained here.

Eren Ersönmez
  • 38,383
  • 7
  • 71
  • 92
  • Rotates a png file. Not actually drawing. Which, to me, takes away the advantage of WPF where everything is drawn and looks smooth at any scaling. – Clint StLaurent Jul 16 '14 at 18:30
  • @ClintStLaurent Not everything has to be vector based in WPF. In this case, imaging is simpler to implement and as a bonus, it is more efficient than vector graphics. However, the main point of this technique was changing the animation rate in order to make the visual look "static". So you can certainly 1) pick a different image sized for your use case, 2) swap out the Image with a Path if you'd like. Same technique would still apply. – Eren Ersönmez Jul 16 '14 at 21:39