Events and Callback
Events and Callback provide a mechanism for developers to receive notifications when specific actions occur within the panel, allowing for responsive and dynamic UI behavior.
Overview
Event Details
Event Name
Category
Description
Code Examples
Subscribing to Events
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;
namespace DemoApp
{
public class MainForm : Form
{
private SiticoneAdvancedPanel advancedPanel;
public MainForm()
{
// Initialize the advanced panel control
advancedPanel = new SiticoneAdvancedPanel
{
Size = new Size(400, 300),
Location = new Point(50, 50),
BackColor = Color.White
};
// Subscribe to events
advancedPanel.SystemThemeChanged += AdvancedPanel_SystemThemeChanged;
advancedPanel.RippleEffectStarted += AdvancedPanel_RippleEffectStarted;
advancedPanel.VisualStyleChanged += AdvancedPanel_VisualStyleChanged;
advancedPanel.KeyboardFocusReceived += AdvancedPanel_KeyboardFocusReceived;
Controls.Add(advancedPanel);
}
private void AdvancedPanel_SystemThemeChanged(object sender, SiticoneAdvancedPanel.SystemThemeChangedEventArgs e)
{
// Handle theme change
MessageBox.Show($"System theme changed to: {e.NewTheme}");
}
private void AdvancedPanel_RippleEffectStarted(object sender, SiticoneAdvancedPanel.RippleEffectEventArgs e)
{
// Handle ripple effect start
Console.WriteLine($"Ripple effect started at: {e.Origin}");
}
private void AdvancedPanel_VisualStyleChanged(object sender, SiticoneAdvancedPanel.VisualStyleChangedEventArgs e)
{
// Handle visual style changes
Console.WriteLine($"Visual style property changed: {e.PropertyName}");
}
private void AdvancedPanel_KeyboardFocusReceived(object sender, SiticoneAdvancedPanel.KeyboardFocusEventArgs e)
{
// Handle keyboard focus changes
Console.WriteLine($"Keyboard focus received: {e.HasFocus}");
}
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
}
}Unsubscribing from Events
Key Points
Aspect
Details
Best Practices
Recommendation
Explanation
Common Pitfalls
Pitfall
How to Avoid It
Usage Scenarios
Scenario
Description
Review
Review Point
Key Consideration
Summary
Additional Sections
Troubleshooting
Issue
Possible Cause
Suggested Solution
Integration Checklist
Step
Description
Last updated