Loading...
Loading...
Comprehensive guide for implementing the Syncfusion WPF Busy Indicator (SfBusyIndicator) control in Windows Presentation Foundation applications. Use this skill when working with loading indicators, progress animations, or visual feedback during async and long-running operations in WPF. Covers IsBusy binding, AnimationType configuration, header customization, MVVM integration, and sizing with ViewboxHeight/ViewboxWidth.
npx skill4agent add syncfusion/wpf-ui-components-skills syncfusion-wpf-busy-indicatorSyncfusion.SfBusyIndicator.WPFSyncfusion.Windows.Controls.NotificationSyncfusion.SfBusyIndicator.WPF<Window xmlns:syncfusion="clr-namespace:Syncfusion.Windows.Controls.Notification;assembly=Syncfusion.SfBusyIndicator.WPF"
x:Class="BusyIndicatorApp.MainWindow">
<Grid Background="CornflowerBlue">
<syncfusion:SfBusyIndicator IsBusy="True"
AnimationType="Flight"
Header="Loading..."
Foreground="White"/>
</Grid>
</Window><Grid>
<syncfusion:SfBusyIndicator IsBusy="{Binding IsLoading}"
AnimationType="DoubleCircle"
Header="{Binding LoadingMessage}"/>
</Grid>public class MainViewModel : INotifyPropertyChanged
{
private bool _isLoading;
public bool IsLoading
{
get => _isLoading;
set { _isLoading = value; OnPropertyChanged(); }
}
private string _loadingMessage = "Please wait...";
public string LoadingMessage
{
get => _loadingMessage;
set { _loadingMessage = value; OnPropertyChanged(); }
}
public async Task LoadDataAsync()
{
IsLoading = true;
LoadingMessage = "Loading data...";
await Task.Delay(3000); // Simulate operation
IsLoading = false;
}
}public class DataViewModel : ViewModelBase
{
private bool _isBusy;
public bool IsBusy
{
get => _isBusy;
set => SetProperty(ref _isBusy, value);
}
public ICommand LoadCommand { get; }
public DataViewModel()
{
LoadCommand = new RelayCommand(async () => await LoadDataAsync());
}
private async Task LoadDataAsync()
{
IsBusy = true;
try
{
var data = await _dataService.GetDataAsync();
// Process data
}
finally
{
IsBusy = false;
}
}
}<StackPanel>
<ComboBox x:Name="AnimationSelector" SelectedIndex="0">
<ComboBoxItem Content="Flight"/>
<ComboBoxItem Content="DoubleCircle"/>
<ComboBoxItem Content="Spin"/>
</ComboBox>
<syncfusion:SfBusyIndicator IsBusy="True"
AnimationType="{Binding ElementName=AnimationSelector,
Path=SelectedItem.Content}"/>
</StackPanel><Grid>
<!-- Main content -->
<ContentControl Content="{Binding MainContent}"/>
<!-- Overlay busy indicator -->
<Grid Background="#80000000"
Visibility="{Binding IsBusy, Converter={StaticResource BoolToVisibilityConverter}}">
<syncfusion:SfBusyIndicator IsBusy="{Binding IsBusy}"
AnimationType="Ball"
Header="Processing..."
Foreground="White"
ViewboxHeight="150"
ViewboxWidth="150"/>
</Grid>
</Grid><syncfusion:SfBusyIndicator IsBusy="{Binding IsProcessing}">
<syncfusion:SfBusyIndicator.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding CurrentOperation}"
FontSize="14" FontWeight="Bold"/>
<TextBlock Text="{Binding ProgressPercentage, StringFormat='Progress: {0}%'}"
FontSize="11" Margin="0,5,0,0"/>
</StackPanel>
</DataTemplate>
</syncfusion:SfBusyIndicator.HeaderTemplate>
</syncfusion:SfBusyIndicator>| Property | Type | Description |
|---|---|---|
| IsBusy | bool | Controls whether the animation is displayed |
| AnimationType | AnimationTypes | Sets the animation style (Flight, Spin, etc.) |
| AnimationSpeed | double | Controls animation speed (not for Fluent type) |
| Header | object | Text or content displayed below animation |
| HeaderTemplate | DataTemplate | Custom template for header content |
| ViewboxHeight | double | Height of the animation viewbox |
| ViewboxWidth | double | Width of the animation viewbox |
| Method | Description |
|---|---|
| Dispose() | Releases managed and unmanaged resources |
| Dispose(Boolean) | Protected overload for resource cleanup |
| OnApplyTemplate() | Override to access template parts |
| OnAnimationTypeChanged() | Override to handle animation type changes |
| OnPropertyChanged() | Override to monitor property changes |
getting-started.md