Class RadToggleSwitchElement
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadToggleSwitchElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
RadToggleSwitchElement()
Declaration
public RadToggleSwitchElement()
Fields
IsOnProperty
Identifies the IsOn dependency property.
Declaration
public static RadProperty IsOnProperty
Field Value
|
RadProperty
|
ThumbOffsetProperty
Identifies the ThumbOffset dependency property.
Declaration
public static RadProperty ThumbOffsetProperty
Field Value
|
RadProperty
|
ThumbTicknessProperty
Identifies the ThumbTickness dependency property.
Declaration
public static RadProperty ThumbTicknessProperty
Field Value
|
RadProperty
|
Properties
AllowAnimation
Gets or sets a value indicating whether animation effects are used when the toggle switch changes state.
Declaration
public bool AllowAnimation { get; set; }
Property Value
|
System.Boolean
|
AnimationFrames
Gets or sets the total number of animation frames used during state transitions.
Declaration
public int AnimationFrames { get; set; }
Property Value
|
System.Int32
|
AnimationInterval
Gets or sets the time interval in milliseconds between animation frames during state transitions.
Declaration
public int AnimationInterval { get; set; }
Property Value
|
System.Int32
|
DragSize
Gets or sets the size of the drag threshold area that determines when a mouse operation is considered a drag versus a click.
Declaration
public int DragSize { get; set; }
Property Value
|
System.Int32
|
IsAnimating
Gets a value indicating whether the toggle switch is currently performing an animation transition.
Declaration
public bool IsAnimating { get; set; }
Property Value
|
System.Boolean
|
IsOn
Gets a value indicating whether the toggle switch is currently in the "On" state.
Declaration
public bool IsOn { get; }
Property Value
|
System.Boolean
|
OffElement
Gets the visual element that represents the "Off" state of the toggle switch.
Declaration
public ToggleSwitchPartElement OffElement { get; protected set; }
Property Value
|
ToggleSwitchPartElement
|
OffText
Gets or sets the text displayed on the toggle switch when it is in the "Off" state.
Declaration
public string OffText { get; set; }
Property Value
|
System.String
|
OnElement
Gets the visual element that represents the "On" state of the toggle switch.
Declaration
public ToggleSwitchPartElement OnElement { get; protected set; }
Property Value
|
ToggleSwitchPartElement
|
OnText
Gets or sets the text displayed on the toggle switch when it is in the "On" state.
Declaration
public string OnText { get; set; }
Property Value
|
System.String
|
ReadOnly
Gets or sets a value indicating whether the toggle switch value can be modified by user interaction.
Declaration
public bool ReadOnly { get; set; }
Property Value
|
System.Boolean
|
SwitchElasticity
Gets or sets the elasticity factor that determines how far the thumb must be dragged before the switch changes state.
Declaration
public double SwitchElasticity { get; set; }
Property Value
|
System.Double
|
Thumb
Gets the movable thumb element that indicates the current state of the toggle switch.
Declaration
public ToggleSwitchThumbElement Thumb { get; protected set; }
Property Value
|
ToggleSwitchThumbElement
|
ThumbOffset
Gets or sets the horizontal offset position of the thumb element within the toggle switch.
Declaration
public int ThumbOffset { get; set; }
Property Value
|
System.Int32
|
ThumbTickness
Gets or sets the width of the thumb element in pixels.
Declaration
[VsbBrowsable(true)]
public int ThumbTickness { get; set; }
Property Value
|
System.Int32
|
ToggleStateMode
Gets or sets the mode that determines how the toggle switch responds to mouse interactions such as clicks and drag operations.
Declaration
public ToggleStateMode ToggleStateMode { get; set; }
Property Value
|
ToggleStateMode
|
Value
Gets or sets the boolean value representing the current state of the toggle switch.
Declaration
public bool Value { get; set; }
Property Value
|
System.Boolean
|
Methods
ArrangeOverride(SizeF)
Arranges the child elements within the specified final size bounds.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
|
System.Drawing.SizeF
finalSize
The final area within which this element should arrange itself and its children. |
Returns
|
System.Drawing.SizeF
The actual size used by the element. |
Overrides
CancelAnimation()
Cancels the currently running animation.
Declaration
public void CancelAnimation()
CreateChildElements()
Creates and initializes the child elements that make up the toggle switch visual structure.
Declaration
protected override void CreateChildElements()
Overrides
CreatePartElement()
Creates and returns a new instance of a toggle switch part element.
Declaration
protected virtual ToggleSwitchPartElement CreatePartElement()
Returns
|
ToggleSwitchPartElement
A new ToggleSwitchPartElement instance. |
CreateThumbElement()
Creates and returns a new instance of the thumb element used for user interaction.
Declaration
protected virtual ToggleSwitchThumbElement CreateThumbElement()
Returns
|
ToggleSwitchThumbElement
A new ToggleSwitchThumbElement instance. |
DisposeManagedResources()
Releases the managed resources used by the RadToggleSwitchElement.
Declaration
protected override void DisposeManagedResources()
Overrides
GetClientRectangle(SizeF)
Declaration
protected override RectangleF GetClientRectangle(SizeF finalSize)
Parameters
|
System.Drawing.SizeF
finalSize
|
Returns
|
System.Drawing.RectangleF
|
Overrides
GetClipRect()
Declaration
protected override RectangleF GetClipRect()
Returns
|
System.Drawing.RectangleF
|
Overrides
InitializeFields()
Initializes the default field values for the RadToggleSwitchElement.
Declaration
protected override void InitializeFields()
Overrides
OnAnimationFinished(AnimationStatusEventArgs)
Declaration
protected virtual void OnAnimationFinished(AnimationStatusEventArgs e)
Parameters
|
AnimationStatusEventArgs
e
|
OnAnimationStarted(AnimationStatusEventArgs)
Declaration
protected virtual void OnAnimationStarted(AnimationStatusEventArgs e)
Parameters
|
AnimationStatusEventArgs
e
|
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
|
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnValueChanged()
Declaration
protected virtual void OnValueChanged()
OnValueChanging(ValueChangingEventArgs)
Declaration
protected virtual void OnValueChanging(ValueChangingEventArgs e)
Parameters
|
ValueChangingEventArgs
e
|
PaintBorder(IGraphics, Single, SizeF)
Declaration
protected override void PaintBorder(IGraphics graphics, float angle, SizeF scale)
Parameters
|
IGraphics
graphics
|
|
System.Single
angle
|
|
System.Drawing.SizeF
scale
|
Overrides
ProcessAnimation()
Declaration
protected virtual void ProcessAnimation()
SetToggleState(Boolean)
Sets the value of RadToggleSwitch.
Declaration
public void SetToggleState(bool newValue)
Parameters
|
System.Boolean
newValue
The new value. |
SetToggleState(Boolean, Boolean)
Sets the value of RadToggleSwitch.
Declaration
public void SetToggleState(bool newValue, bool animate)
Parameters
|
System.Boolean
newValue
The new value. |
|
System.Boolean
animate
Indicates whether to use animation. |
Toggle()
Toggles the value of RadToggleSwitch
Declaration
public void Toggle()
Toggle(Boolean)
Toggles the value of RadToggleSwitch
Declaration
public void Toggle(bool animate)
Parameters
|
System.Boolean
animate
Indicates whether to use animation. |
Events
AnimationFinished
Occurs when an animation transition completes.
Declaration
public event AnimationFinishedEventHandler AnimationFinished
Event Type
|
AnimationFinishedEventHandler
|
AnimationStarted
Occurs when an animation transition starts.
Declaration
public event AnimationStartedEventHandler AnimationStarted
Event Type
|
AnimationStartedEventHandler
|
ValueChanged
Occurs after the value of the toggle switch has changed.
Declaration
public event EventHandler ValueChanged
Event Type
|
System.EventHandler
|
ValueChanging
Occurs before the value of the toggle switch changes and allows the change to be cancelled.
Declaration
public event ValueChangingEventHandler ValueChanging
Event Type
|
ValueChangingEventHandler
|