Siticone Activity Button
The SiticoneActivityButton is a highly interactive control that combines standard button functionality with a built-in activity indicator.
It is designed to provide immediate visual feedback for long-running operations without requiring external progress bars or loading spinners.
Features include customizable loading animations (spinners, dots, progress bars, spring arcs), text replacement during activity, and comprehensive theming.
State & Behavior
Control the button's operational mode and interactivity.
| Property | Type | Description & Usage Example |
|---|---|---|
IsBusy |
bool |
btn.IsBusy = true;
When set to true, the button enters the "Busy" state.
It displays the activity indicator, switches text to ActivityText, and ignores click events.
|
ActivityDuration |
int |
btn.ActivityDuration = 2000;
The duration in milliseconds for the activity indicator to run if started via StartActivity(). Set to 0 for infinite duration.
|
UltraPerformanceMode |
bool | btn.UltraPerformanceMode = true; When enabled, disables animations, shadows, and ripple effects to maximize rendering performance in high-density UIs. |
Text & Content
Manage the text displayed during normal and busy states.
| Property | Type | Description & Usage Example |
|---|---|---|
Text |
string | btn.Text = "Submit Order"; The primary text displayed when the button is idle. |
ActivityText |
string |
btn.ActivityText = "Processing...";
The text displayed when IsBusy is true.
|
ShowActivityText |
bool | btn.ShowActivityText = true; Determines whether to show text alongside the activity indicator. |
TextColor |
Color | btn.TextColor = Color.White; |
Activity Indicator
Customize the visual style of the loading animation.
| Property | Type | Description & Usage Example |
|---|---|---|
ActivityIndicatorStyle |
ActivityIndicatorStyleFx |
btn.ActivityIndicatorStyle = ActivityIndicatorStyleFx.SpringArc;
The animation style: Dots, Spinner, ProgressBar, MaterialRadial, SpringArc, DoubleBounce, etc.
|
ActivityIndicatorColor |
Color | btn.ActivityIndicatorColor = Color.White; The color of the loading indicator graphics. |
ActivityIndicatorSize |
int | btn.ActivityIndicatorSize = 4; The size/thickness of the indicator elements. |
ActivityIndicatorSpeed |
int | btn.ActivityIndicatorSpeed = 100; The update interval in milliseconds. Lower values mean faster animation. |
Spring Arc Customization
Specific settings for the advanced SpringArc indicator style.
| Property | Type | Description & Usage Example |
|---|---|---|
SpringConstant |
double | btn.SpringConstant = 0.04; Controls the elasticity of the arc animation. |
RotationSpeed |
double | btn.RotationSpeed = 6.0; The speed at which the arc rotates. |
UseMultipleColors |
bool | btn.UseMultipleColors = true; If true, the arc cycles through a list of colors during animation. |
CustomArcColors |
Color[] |
btn.CustomArcColors = new[] { Color.Red, Color.Blue };
An array of colors to cycle through when UseMultipleColors is active.
|
Progress Bar
Settings for the linear progress indicator style.
| Property | Type | Description & Usage Example |
|---|---|---|
ProgressValue |
int | btn.ProgressValue = 75; Current progress percentage (0-100). |
AnimateProgressChanges |
bool | btn.AnimateProgressChanges = true; Smoothly interpolates between old and new progress values. |
ProgressDuration |
int | btn.ProgressDuration = 500; Duration of the smoothing animation in milliseconds. |
Colors & Theming
Visual configuration for the button's appearance.
| Property | Type | Description & Usage Example |
|---|---|---|
Theme |
ActivityButtonTheme | btn.Theme = ActivityButtonTheme.MaterialBlue; Applies a preset color scheme (e.g., Light, Dark, MaterialGreen, Colorful). |
BaseColor |
Color | btn.BaseColor = Color.DodgerBlue; |
HoverColor |
Color | btn.HoverColor = Color.SkyBlue; |
PressedColor |
Color | btn.PressedColor = Color.Navy; |
DisabledColor |
Color | btn.DisabledColor = Color.Gray; |
BorderColor |
Color | btn.BorderColor = Color.Black; |
BorderWidth |
int | btn.BorderWidth = 2; |
CornerRadiusTopLeft |
int | btn.CornerRadiusTopLeft = 5; |
Public Methods
// Starts the activity indicator.
// duration: Milliseconds to run (0 for infinite).
// style: Optional indicator style override.
activityBtn.StartActivity(0, ActivityIndicatorStyleFx.Spinner);
// Stops the activity indicator and restores original text.
// resetStyle: If true, resets the indicator style to default (Dots).
activityBtn.StopActivity(false);
// Sets the button to a persistent busy state, blocking clicks.
activityBtn.SetBusy();
// Clears the busy state and re-enables interaction.
activityBtn.ClearBusy();
// Updates the progress bar value with animation.
activityBtn.SetProgress(75);
// Helper to start the colorful spring arc animation.
activityBtn.StartSpringArcActivity();
Designer Support
The control includes a Smart Tag panel for quick configuration.
| Category | Features |
|---|---|
Performance |
UltraPerformanceMode: Toggle optimization directly. |
Text & State |
Set Text, ActivityText, and toggle IsBusy. |
Theme Preset |
Apply themes: Light, Dark, Material Blue/Green/Red, Colorful, Minimal. |
Activity Indicator |
Select Style and set Color. |
Copy / Paste |
Transfer settings between button instances. |
Detailed Examples
Example 1: Login Button with Spinner
Simulating an authentication process.
private async void BtnLogin_Click(object sender, EventArgs e)
{
// Set busy to block double-clicks
btnLogin.SetBusy(ActivityIndicatorStyleFx.Spinner);
btnLogin.ActivityText = "Authenticating...";
await Task.Delay(2000); // Simulate network request
btnLogin.ClearBusy();
btnLogin.Text = "Success!";
btnLogin.BaseColor = Color.Green;
}
Example 2: File Upload with Progress Bar
Using the progress indicator style.
private void StartUpload()
{
btnUpload.ActivityIndicatorStyle = ActivityIndicatorStyleFx.ProgressBar;
btnUpload.ActivityText = "Uploading...";
btnUpload.StartActivity(); // Infinite duration until we stop it
// Simulate progress updates
for (int i = 0; i <= 100; i += 10)
{
btnUpload.SetProgress(i);
await Task.Delay(200);
}
btnUpload.StopActivity();
btnUpload.Text = "Upload Complete";
}
Example 3: Material Arc with Custom Colors
Configuring a colorful spring arc animation.
public void SetupArcButton()
{
btnSync.ActivityIndicatorStyle = ActivityIndicatorStyleFx.SpringArc;
btnSync.UseMultipleColors = true;
btnSync.CustomArcColors = new[]
{
Color.Cyan,
Color.Magenta,
Color.Yellow
};
btnSync.Click += (s, e) =>
{
// Start animation for 3 seconds
btnSync.StartActivity(3000);
};
}