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

Represents a customizable button control within the Telerik UI for WPF framework. The RadButton class derives from the Button class and includes additional properties, events, and behaviors that enhance its functionality, such as support for hover effects, corner radius customization, and command binding. It introduces dependency properties like HoverDelay to manage hover interactions, CornerRadius and InnerCornerRadius for visual styling, and routed events like Activate and Hover to handle button interactions. The RadButton also provides visual state management and integrates well with command patterns for MVVM design.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
[TelerikToolboxCategory("Buttons")]
public class RadButton : Button

Inheritance: objectRadButton

Derived Classes: RadGeometryButtonGroupHeaderButtonRadAIPromptButtonRadDropDownButtonRadHyperlinkButtonRadImageEditorButtonRadPathButtonRadRibbonButtonRadSpeechToTextButton...

Constructors

Initializes a new instance of the RadButton class.

C#
public RadButton()

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

HoverDelayProperty

DependencyProperty

Identifies the HoverDelay property.

C#
public static readonly DependencyProperty HoverDelayProperty

HoverEvent

RoutedEvent

Identifies the Hover routed event.

C#
public static readonly RoutedEvent HoverEvent

IsBackgroundVisibleProperty

DependencyProperty

Identifies the IsBackgroundVisible property.

C#
public static readonly DependencyProperty IsBackgroundVisibleProperty

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; }

Gets or sets whether the popup opens when mouse hovers for pointed milliseconds Value of zero means no auto open. This is a dependency property.

C#
[Browsable(false)]
public TimeSpan HoverDelay { get; set; }

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

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

Methods

Raises the event.

C#
protected virtual void OnActivate()

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

C#
public override void OnApplyTemplate()

Invoke the base OnClick and execute the associated Command.

C#
protected override void OnClick()

Creates a RadButtonAutomationPeer.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

Invoked on got focus.

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

Invocated when the hover happens.

C#
protected virtual void OnHover()

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.

Called when the IsPressed property changes.

C#
protected override void OnIsPressedChanged(DependencyPropertyChangedEventArgs e)
Parameters:eDependencyPropertyChangedEventArgs

Invoked on focus lost.

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

Starts the auto open timer.

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

Stops the auto open timer.

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

Restarts the auto open timer.

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

Events

Occurs when button is clicked.

C#
public event EventHandler<RadRoutedEventArgs> Activate

Occurs when button is hovered.

C#
[Browsable(false)]
public event EventHandler<RadRoutedEventArgs> Hover