Class
RadToggleButton

Represents a toggle button control that allows users to switch between two states: checked and unchecked. This control supports customization of corner radius, background visibility, and command binding for a more interactive user experience. The RadToggleButton raises events when activated and allows pre-click handling through the PreviewClick event. It also provides visual state management to reflect different interaction states like mouse over, pressed, and focused.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
[TelerikToolboxCategory("Buttons")]
public class RadToggleButton : ToggleButton

Inheritance: objectRadToggleButton

Derived Classes: RadGeometryToggleButtonRadRibbonToggleButtonRadToggleSwitchButton

Constructors

RadToggleButton()

Initializes a new instance of the RadToggleButton class.

Declaration

cs-api-definition
public RadToggleButton()

Fields

ActivateEvent

Identifies the Activate routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent ActivateEvent

Field Value

RoutedEvent

CornerRadiusProperty

Identifies the CornerRadius property.

Declaration

cs-api-definition
public static readonly DependencyProperty CornerRadiusProperty

Field Value

DependencyProperty

IsBackgroundVisibleProperty

Identifies the IsBackgroundVisible property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsBackgroundVisibleProperty

Field Value

DependencyProperty

PreviewClickEvent

Identifies the PreviewClick property.

Declaration

cs-api-definition
public static readonly RoutedEvent PreviewClickEvent

Field Value

RoutedEvent

Properties

CornerRadius

Gets or sets a value that represents the degree to which the corners of the control are rounded. This is a dependency property.

Declaration

cs-api-definition
public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius

IsBackgroundVisible

Sets the visual appearance of the chrome not to render in Normal mode.

Declaration

cs-api-definition
[Browsable(false)]
public bool IsBackgroundVisible { get; set; }

Property Value

bool

Methods

OnApplyTemplate()

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call .

Declaration

cs-api-definition
public override void OnApplyTemplate()

OnClick()

Called when a control is clicked by the mouse or the keyboard.

Declaration

cs-api-definition
protected override void OnClick()

OnCreateAutomationPeer()

Creates a RadToggleButtonAutomationPeer.

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

OnGotFocus(RoutedEventArgs)

Invoked on got focus.

Declaration

cs-api-definition
protected override void OnGotFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

OnInitialized(EventArgs)

Raises the event. This method is invoked whenever is set to true internally.

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

The RoutedEventArgs that contains the event data.

OnLostFocus(RoutedEventArgs)

Invoke on focus lost.

Declaration

cs-api-definition
protected override void OnLostFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

OnMouseEnter(MouseEventArgs)

Invoke on mouse enter.

Declaration

cs-api-definition
protected override void OnMouseEnter(MouseEventArgs e)

Parameters

e

MouseEventArgs

OnMouseLeave(MouseEventArgs)

Invoke on mouse leave.

Declaration

cs-api-definition
protected override void OnMouseLeave(MouseEventArgs e)

Parameters

e

MouseEventArgs

OnMouseLeftButtonUp(MouseButtonEventArgs)

Invoke on mouse left button up.

Declaration

cs-api-definition
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)

Parameters

e

MouseButtonEventArgs

Events

Activate

Occurs when button is clicked.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> Activate

Event Value

EventHandler<RadRoutedEventArgs>

PreviewClick

Occurs when the content will be Clicked. If the event handler set True for the Handled property then the button will not be clicked.

Declaration

cs-api-definition
public event RoutedEventHandler PreviewClick

Event Value

RoutedEventHandler