Events and Callbacks
Events & Callbacks provide a mechanism to respond to progress changes and animation state transitions, enabling developers to integrate custom logic in response to the control's internal state changes
Overview
API Reference
Feature Element
Type
Default Value
Description
Code Examples
Example 1: Handling Progress Changes
// Instantiate the progress bar control.
var progressBar = new SiticoneHBarsProgress();
// Subscribe to the ProgressChanged event.
progressBar.ProgressChanged += (sender, e) =>
{
// Log the old and new progress values.
Console.WriteLine($"Progress updated from {e.OldValue} to {e.NewValue}");
// Custom logic: update another UI element (e.g., a label) with the new percentage.
myLabel.Text = $"Progress: {progressBar.Percentage}%";
};
// Update the progress value to trigger the event.
progressBar.Value = 80;Example 2: Detecting Animation Completion
Example 3: Responding to Animation State Changes
Key Points
Aspect
Details
Best Practices
Practice
Description
Common Pitfalls
Pitfall
Cause/Resolution
Usage Scenarios
Scenario
Implementation Details
Review
Category
Review Comments
Summary
Additional Notes
Note
Details
Last updated