Event Notifications
This feature notifies developers when key interactions occur, such as system theme changes, visual style updates, ripple animations, and keyboard focus events.
Overview
Key Points
Event Name
Description
Event Arguments Type
Default Behavior/Notes
Code Examples and Samples
Subscribing to Event Notifications
// Create an instance of SiticonePanel
var myPanel = new SiticonePanel
{
Width = 300,
Height = 200,
FillColor = Color.White,
EnableRippleEffect = true
};
// Subscribe to SystemThemeChanged event
myPanel.SystemThemeChanged += (sender, e) =>
{
MessageBox.Show("System theme changed to: " + e.NewTheme);
};
// Subscribe to VisualStyleChanged event
myPanel.VisualStyleChanged += (sender, e) =>
{
Console.WriteLine("Visual style property changed: " + e.PropertyName);
};
// Subscribe to RippleEffectStarted event
myPanel.RippleEffectStarted += (sender, e) =>
{
Console.WriteLine("Ripple effect started at: " + e.Origin.ToString());
};
// Subscribe to KeyboardFocusReceived event
myPanel.KeyboardFocusReceived += (sender, e) =>
{
Console.WriteLine("Keyboard focus: " + (e.HasFocus ? "Gained" : "Lost"));
};
// Add the panel to the form
this.Controls.Add(myPanel);Handling Theme Changes Dynamically
Best Practices
Practice
Details
Example Implementation
Common Pitfalls
Pitfall
Description
How to Avoid
Usage Scenarios
Scenario
Description
Example Code
Review
Summary
Conclusion
Additional Considerations
Consideration
Details
Last updated