Events and Callbacks
This feature provides a set of events and callbacks that allow developers to respond to spinner state changes, progress updates, and animation milestones in real time.
Overview
Detailed Events and Callbacks
Event / Callback
Description
EventArgs Type
Code Examples & Integration Samples
Handling Spinner State Changes
// Create an instance of the spinner control.
var spinner = new SiticoneLoadingSpinner();
// Subscribe to the SpinnerStateChanged event.
spinner.SpinnerStateChanged += (sender, e) =>
{
if (e.IsRunning)
{
Console.WriteLine("Spinner started.");
}
else
{
Console.WriteLine("Spinner stopped.");
}
};
// Start and then stop the spinner.
spinner.Start();
Thread.Sleep(2000); // Simulate some work.
spinner.Stop();Responding to Rotation Completion
Integrating Progress Updates
Handling Background Work Completion
Key Points
Aspect
Details
Best Practices
Best Practice
Recommendation
Common Pitfalls
Common Issue
Explanation & Resolution
Usage Scenarios
Scenario
Description & Sample Code
Review
Summary
Additional Tips
Tip
Recommendation
Last updated