Siticone Card
The SiticoneCard is a versatile, high-performance container control designed for modern Windows Forms applications.
It extends the standard Panel with Material Design elevation, gradient backgrounds, interactive animations (Ripple, Hover, Shimmer),
and a built-in notification badge system.
Appearance & Gradients
Define the visual foundation of the card using gradients, borders, and corner styling.
| Property | Type | Description & Usage Example |
|---|---|---|
BackgroundColor1 |
Color | card.BackgroundColor1 = Color.White; The starting color of the background gradient. |
BackgroundColor2 |
Color | card.BackgroundColor2 = Color.WhiteSmoke; The ending color of the background gradient. |
BackgroundAngle |
float | card.BackgroundAngle = 45f; The angle (in degrees) of the background gradient. |
BorderColor1 |
Color | card.BorderColor1 = Color.DodgerBlue; Primary color for the border gradient. |
BorderColor2 |
Color | card.BorderColor2 = Color.RoyalBlue; Secondary color for the border gradient. |
BorderWidth |
float |
card.BorderWidth = 2f;
Thickness of the border. Set to 0 to hide, or use ShowBorder = false.
|
EnableCustomBorderStyle |
bool |
card.EnableCustomBorderStyle = true;
Enables advanced border styles defined in BorderStyleEx.
|
BorderStyleEx |
CustomBorderStyleFx | card.BorderStyleEx = CustomBorderStyleFx.Dashed; Sets the style pattern (Solid, Dashed, Dotted, etc.) when custom borders are enabled. |
Corners & Shape
Control the geometry of the card with independent corner radii.
| Property | Type | Description & Usage Example |
|---|---|---|
TopLeftRadius |
int | card.TopLeftRadius = 15; |
TopRightRadius |
int | card.TopRightRadius = 15; |
BottomLeftRadius |
int | card.BottomLeftRadius = 15; |
BottomRightRadius |
int | card.BottomRightRadius = 15; |
Shadow & Elevation
Apply depth using Material Design principles or manual shadow control.
| Property | Type | Description & Usage Example |
|---|---|---|
Elevation |
int | card.Elevation = 6; Automatically sets shadow depth and opacity based on Material Design guidelines (0-24). |
ShadowDepth |
int | card.ShadowDepth = 10; Manual control for the size of the shadow blur. |
ShadowOpacity |
int | card.ShadowOpacity = 50; Alpha transparency of the shadow (0-255). |
ShadowColor |
Color | card.ShadowColor = Color.Black; |
Animation & Effects
Interactive visual feedback for clicking, hovering, and loading states.
| Property | Type | Description & Usage Example |
|---|---|---|
EnableRippleEffect |
bool | card.EnableRippleEffect = true; Toggles the expanding circular ripple animation on click. |
RippleColor |
Color | card.RippleColor = Color.FromArgb(50, Color.White); |
EnableClickEffect |
bool | card.EnableClickEffect = true; Toggles the scaling "press" animation when clicked. |
ClickScaleEffect |
float | card.ClickScaleEffect = 0.98f; The scale factor when pressed (e.g., 0.98 shrinks to 98%). |
EnableShimmerEffect |
bool | card.EnableShimmerEffect = true; Adds a moving shine effect, ideal for loading states (Skeleton UI). |
ShimmerColor |
Color | card.ShimmerColor = Color.FromArgb(40, Color.White); |
ShimmerSpeed |
float | card.ShimmerSpeed = 5f; |
Interaction
Properties controlling hover states, dragging, and context menus.
| Property | Type | Description & Usage Example |
|---|---|---|
EnableHoverEffect |
bool | card.EnableHoverEffect = true; Enables transition of background, border, and shadow on mouse hover. |
HoverBackColor |
Color | card.HoverBackColor = Color.WhiteSmoke; |
HoverBorderColor |
Color | card.HoverBorderColor = Color.DodgerBlue; |
EnableDragging |
bool | card.EnableDragging = true; Allows the user to drag and drop the card within its container. |
EnableContextMenu |
bool | card.EnableContextMenu = true; Enables right-click context menu support. |
ContextMenu |
ContextMenuStrip | card.ContextMenu = myContextMenuStrip; |
Badge System
Integrated notification badge for displaying counts or alerts.
| Property | Type | Description & Usage Example |
|---|---|---|
BadgeValue |
int | card.BadgeValue = 5; The number to display. 0 hides the badge. Values > 99 show as "99+". |
BadgeColor |
Color | card.BadgeColor = Color.Crimson; |
BadgeTextColor |
Color | card.BadgeTextColor = Color.White; |
BadgePosition |
BadgePosition | card.BadgePosition = BadgePosition.TopRight; |
Behavior & Performance
Configuration for performance optimization and special interaction modes.
| Property | Type | Description & Usage Example |
|---|---|---|
IsReadonly |
bool | card.IsReadonly = true; Locks the card from interaction. Clicks trigger shake/beep if enabled. |
CanShake |
bool | card.CanShake = true; Triggers a shake animation when a ReadOnly card is clicked. |
UltraPerformance |
bool | card.UltraPerformance = true; Disables all animations (Ripple, Shimmer, Hover, Shadow) for maximum performance. Ideal for lists containing many cards. |
Dynamic Content
Data binding capabilities to automatically generate child controls.
| Property | Type | Description & Usage Example |
|---|---|---|
EnableDynamicContent |
bool | card.EnableDynamicContent = true; |
DataSource |
object | card.DataSource = myUserObject; The data object to bind to the card. |
ContentGenerator |
Func<object, Control> | card.ContentGenerator = (data) => new Label { Text = data.ToString() }; A function that takes the DataSource and returns a Control to render. |
Events
// 1. Dragging Events
// Fired when EnableDragging is true and user moves the card
card.DragStarted += (s, e) => {
Debug.WriteLine("Dragging started...");
card.Alpha = 0.5f; // Example: Make semi-transparent while dragging
};
card.DragCompleted += (s, e) => {
Debug.WriteLine("Dragging finished.");
card.Alpha = 1.0f;
};
// 2. Content Loaded
// Fired after ContentGenerator finishes rendering the DataSource
card.ContentLoaded += (s, e) => {
Debug.WriteLine("Dynamic content ready.");
};
// 3. Context Menu
// Fired when the context menu is triggered via right-click
card.ContextMenuOpened += (s, e) => {
Debug.WriteLine("Context menu opened.");
};
Detailed Examples
Example 1: The "Credit Card" Look
Creates a card resembling a credit card with gradients, rounded corners, and a border.
private SiticoneCard CreateCreditCard()
{
var card = new SiticoneCard
{
Size = new Size(300, 180),
// Gradient Background
BackgroundColor1 = Color.FromArgb(45, 52, 54),
BackgroundColor2 = Color.FromArgb(0, 0, 0),
BackgroundAngle = 45f,
// Rounded Corners
TopLeftRadius = 15,
TopRightRadius = 15,
BottomLeftRadius = 15,
BottomRightRadius = 15,
// Border styling
ShowBorder = true,
BorderColor1 = Color.Gold,
BorderColor2 = Color.DarkGoldenrod,
BorderWidth = 1.5f,
// Shadow for depth
Elevation = 8,
// Visual Effects
EnableShimmerEffect = true, // Adds a premium shine
ShimmerColor = Color.FromArgb(50, Color.White)
};
return card;
}
Example 2: Interactive Product Card
A card that responds to hover and clicks, useful for e-commerce interfaces. It includes a badge for "New" items.
private SiticoneCard CreateProductCard()
{
var card = new SiticoneCard
{
Size = new Size(200, 250),
BackgroundColor1 = Color.White,
BackgroundColor2 = Color.White,
// Interaction Configuration
EnableHoverEffect = true,
HoverBackColor = Color.FromArgb(245, 245, 245),
HoverShadowDepth = 15, // Lift up on hover
EnableClickEffect = true, // Scale down on click
EnableRippleEffect = true,
RippleColor = Color.FromArgb(50, Color.Black),
// Notification Badge
BadgeValue = 1,
BadgeColor = Color.Crimson,
BadgePosition = BadgePosition.TopRight
};
return card;
}
Example 3: Dynamic Data Loading
Demonstrates how to use the ContentGenerator to automatically populate the card from a data object.
public class UserProfile
{
public string Username { get; set; }
public string Role { get; set; }
}
private void LoadUserCard(SiticoneCard card)
{
// 1. Enable Dynamic Content
card.EnableDynamicContent = true;
// 2. Define how to render the data
card.ContentGenerator = (data) =>
{
var user = (UserProfile)data;
// Create a panel to hold labels
var panel = new Panel { Dock = DockStyle.Fill, Padding = new Padding(10) };
var lblName = new Label { Text = user.Username, Font = new Font("Segoe UI", 12, FontStyle.Bold), Dock = DockStyle.Top };
var lblRole = new Label { Text = user.Role, ForeColor = Color.Gray, Dock = DockStyle.Top };
panel.Controls.Add(lblRole);
panel.Controls.Add(lblName);
return panel;
};
// 3. Bind Data (Triggering generation)
card.DataSource = new UserProfile { Username = "John Doe", Role = "Administrator" };
}
Example 4: Draggable Widget
Creates a floating widget that can be dragged around the parent form.
private SiticoneCard CreateFloatingWidget()
{
var card = new SiticoneCard
{
Size = new Size(150, 150),
BackgroundColor1 = Color.MediumPurple,
BackgroundColor2 = Color.SlateBlue,
Elevation = 12, // High shadow for "floating" look
// Enable Dragging
EnableDragging = true,
Cursor = Cursors.SizeAll // Visual cue
};
// Optional: Snap to grid on drop
card.DragCompleted += (s, e) =>
{
var c = (SiticoneCard)s;
// Snap to nearest 10px grid
c.Left = (c.Left / 10) * 10;
c.Top = (c.Top / 10) * 10;
};
return card;
}
Example 5: Shimmer Loading State (Skeleton)
Simulates a data loading state using the Shimmer effect and UltraPerformance mode toggling.
private async void LoadDataAsync(SiticoneCard card)
{
// 1. Set Loading State
card.Controls.Clear();
card.EnableShimmerEffect = true;
card.ShimmerColor = Color.FromArgb(100, Color.White);
card.ShimmerSpeed = 8f;
card.BackgroundColor1 = Color.LightGray; // Skeleton base color
card.BackgroundColor2 = Color.LightGray;
// 2. Simulate Async Work
await Task.Delay(3000);
// 3. Set Loaded State
card.EnableShimmerEffect = false;
card.BackgroundColor1 = Color.White;
card.BackgroundColor2 = Color.White;
// Add actual content...
Label lbl = new Label { Text = "Data Loaded Successfully!", Dock = DockStyle.Fill };
card.Controls.Add(lbl);
}