public class WaitIndicator : TemplatedControltype WaitIndicator =
class
inherit TemplatedControl
endA WaitIndicator is a piece of Graphical User Interface, which provides visual information to the user typically about a lengthy background operation taking place. Informing the user about such operation is important so that the user knows that the application is responsive.
WaitIndicator is based on Avalonia TemplatedControl and therefore the entire implementation of its behavior is part of ControlTemplate which is part of its IResourceDictionary stored under DefaultControlTemplate key.
When delivering its graphical output, WaitIndicator takes values of following properties into consideration:
As soon as you make an instance of WaitIndicator visible by setting its IsVisible property to True (which is the default), it will start animating. Once you make WaitIndicator invisible, the animation will also stop. Therefore, it is not necessary to remove it from visual tree, if you plan to show it again later.
Recommended approach to using WaitIndicator is to position it to center of your window/view/screen (container, that is) and make sure it appears on top of any other components. You should also set Width/Height properties to some reasonable values (depending on size of its parent container). To achieve this, make sure that it is the last control added to your container and set its IsVisible property to False. You may optionally set its Text property to some text. Then simply change its visibility, whenever needed.
| WaitIndicator | Initializes a new instance of WaitIndicator class. |
| Text | Gets or sets text which appears under wait indicator animated graphics. |
| InitializeComponent | Wires up the controls and optionally loads XAML markup and attaches dev tools (if Avalonia.Diagnostics package is referenced). |
| TextProperty | Defines the Text property. |