New to Telerik UI for WPFStart a free 30-day trial

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:

C#
[TelerikToolboxCategory("Buttons")]
public class RadToggleButton : ToggleButton

Inheritance: objectRadToggleButton

Derived Classes: RadGeometryToggleButtonRadRibbonToggleButtonRadToggleSwitchButton

Constructors

Initializes a new instance of the RadToggleButton class.

C#
public RadToggleButton()

Fields

ActivateEvent

RoutedEvent

Identifies the Activate routed event.

C#
public static readonly RoutedEvent ActivateEvent

CornerRadiusProperty

DependencyProperty

Identifies the CornerRadius property.

C#
public static readonly DependencyProperty CornerRadiusProperty

IsBackgroundVisibleProperty

DependencyProperty

Identifies the IsBackgroundVisible property.

C#
public static readonly DependencyProperty IsBackgroundVisibleProperty

Identifies the PreviewClick property.

C#
public static readonly RoutedEvent PreviewClickEvent

Properties

CornerRadius

CornerRadius

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

C#
public CornerRadius CornerRadius { get; set; }

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

C#
[Browsable(false)]
public bool IsBackgroundVisible { get; set; }

Methods

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

C#
public override void OnApplyTemplate()

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

C#
protected override void OnClick()

Creates a RadToggleButtonAutomationPeer.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

Invoked on got focus.

C#
protected override void OnGotFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

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

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Invoke on focus lost.

C#
protected override void OnLostFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

Invoke on mouse enter.

C#
protected override void OnMouseEnter(MouseEventArgs e)
Parameters:eMouseEventArgs

Invoke on mouse leave.

C#
protected override void OnMouseLeave(MouseEventArgs e)
Parameters:eMouseEventArgs

Invoke on mouse left button up.

C#
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

Events

Occurs when button is clicked.

C#
public event EventHandler<RadRoutedEventArgs> Activate

PreviewClick

RoutedEventHandler

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

C#
public event RoutedEventHandler PreviewClick