Siticone Material Switch
The SiticoneMaterialSwitch is an interactive toggle control adhering to Material Design principles.
It features ripple click effects, customizable thumb shadows (elevation), and smooth track color transitions.
Appearance
Customize the track and thumb colors for both On and Off states.
| Property | Type | Description |
|---|---|---|
TrackOnColor |
Color | Color of the track when the switch is ON. |
TrackOffColor |
Color | Color of the track when the switch is OFF. |
ThumbOnColor |
Color | Color of the thumb circle when ON. |
ThumbOffColor |
Color | Color of the thumb circle when OFF. |
Dimensions & Layout
Control the physical size and padding of the switch components.
| Property | Type | Description |
|---|---|---|
SwitchWidth |
int | Width of the track area in pixels. |
SwitchHeight |
int | Height of the track area. This also affects the corner radius (pill shape). |
ThumbSize |
int | Diameter of the circular thumb. |
LeftPadding |
int | Space between the left edge of the control and the start of the switch track. |
Visual Effects
Enhance the user experience with shadows and ripple animations.
| Property | Type | Description |
|---|---|---|
EnableRippleEffect |
bool | Enables the expanding circular ripple animation on click. |
RippleColor |
Color | Color of the ripple animation. |
ThumbElevation |
int | Controls the intensity of the shadow under the thumb (simulating elevation). Max value 8. |
ThumbShadowColor |
Color | Color of the drop shadow. |
Behavior
Manage interactivity and state restrictions.
| Property | Type | Description |
|---|---|---|
IsOn |
bool | Gets or sets the checked state. |
ReadOnly |
bool | Prevents the user from changing the state. |
EnableKeyboardSupport |
bool | Allows toggling with the Space bar when focused. |
Events
React to state changes and user actions.
// Fired when the IsOn state changes.
materialSwitch.SwitchStateChanged += (s, e) =>
{
if (e.IsOn)
{
ApplyDarkMode();
}
};
// Fired when a user tries to toggle a ReadOnly switch.
materialSwitch.ReadOnlyInteractionAttempted += (s, e) =>
{
MessageBox.Show("This setting is locked by administrator policy.");
};
Designer Support
The control includes a Smart Tag menu for rapid theming.
| Category | Features |
|---|---|
Themes |
Apply presets like Default iOS, Material Design, Dark, Flat, Minimalist. |
Settings |
Copy/Paste visual settings between multiple switches. |
Usage Examples
Example 1: Material Design Toggle
Standard Material Blue configuration.
private void SetupMaterialSwitch()
{
matSwitch.TrackOnColor = Color.FromArgb(33, 150, 243);
matSwitch.ThumbOnColor = Color.FromArgb(33, 150, 243);
matSwitch.ThumbOffColor = Color.White;
// Enable shadow for elevation
matSwitch.ThumbElevation = 4;
// Ripples
matSwitch.EnableRippleEffect = true;
matSwitch.RippleColor = Color.FromArgb(33, 150, 243);
}
Example 2: Minimalist Toggle
A flat, simple toggle without shadows or ripples.
private void SetupMinimalSwitch()
{
minSwitch.TrackOnColor = Color.DimGray;
minSwitch.TrackOffColor = Color.LightGray;
minSwitch.ThumbOnColor = Color.Black;
minSwitch.ThumbOffColor = Color.White;
// Disable effects
minSwitch.ThumbElevation = 0;
minSwitch.EnableRippleEffect = false;
minSwitch.AnimationDuration = 150; // Fast animation
}
Example 3: Read-Only Status
A toggle that displays status but cannot be changed, with feedback.
private void SetupStatusSwitch(bool isActive)
{
statusSwitch.IsOn = isActive;
statusSwitch.ReadOnly = true;
// Feedback on click
statusSwitch.CanShake = true;
statusSwitch.CanBeep = true;
// Distinct read-only color
statusSwitch.ReadOnlyColor = Color.FromArgb(230, 230, 230);
}