Class
RadButton

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:

cs-api-definition
[TelerikToolboxCategory("Buttons")]
public class RadButton : Button

Inheritance: objectRadButton

Derived Classes: RadGeometryButtonGroupHeaderButtonRadAIPromptButtonRadDropDownButtonRadHyperlinkButtonRadImageEditorButtonRadPathButtonRadRibbonButton

Constructors

RadButton()

Initializes a new instance of the RadButton class.

Declaration

cs-api-definition
public RadButton()

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

HoverDelayProperty

Identifies the HoverDelay property.

Declaration

cs-api-definition
public static readonly DependencyProperty HoverDelayProperty

Field Value

DependencyProperty

HoverEvent

Identifies the Hover routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent HoverEvent

Field Value

RoutedEvent

IsBackgroundVisibleProperty

Identifies the IsBackgroundVisible property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsBackgroundVisibleProperty

Field Value

DependencyProperty

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

HoverDelay

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.

Declaration

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

Property Value

TimeSpan

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

OnActivate()

Raises the event.

Declaration

cs-api-definition
protected virtual void OnActivate()

OnApplyTemplate()

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

Declaration

cs-api-definition
public override void OnApplyTemplate()

OnClick()

Invoke the base OnClick and execute the associated Command.

Declaration

cs-api-definition
protected override void OnClick()

OnCreateAutomationPeer()

Creates a RadButtonAutomationPeer.

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

OnHover()

Invocated when the hover happens.

Declaration

cs-api-definition
protected virtual void OnHover()

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.

OnIsPressedChanged(DependencyPropertyChangedEventArgs)

Called when the IsPressed property changes.

Declaration

cs-api-definition
protected override void OnIsPressedChanged(DependencyPropertyChangedEventArgs e)

Parameters

e

DependencyPropertyChangedEventArgs

OnLostFocus(RoutedEventArgs)

Invoked on focus lost.

Declaration

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

Parameters

e

RoutedEventArgs

OnMouseEnter(MouseEventArgs)

Starts the auto open timer.

Declaration

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

Parameters

e

MouseEventArgs

OnMouseLeave(MouseEventArgs)

Stops the auto open timer.

Declaration

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

Parameters

e

MouseEventArgs

OnMouseMove(MouseEventArgs)

Restarts the auto open timer.

Declaration

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

Parameters

e

MouseEventArgs

Events

Activate

Occurs when button is clicked.

Declaration

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

Event Value

EventHandler<RadRoutedEventArgs>

Hover

Occurs when button is hovered.

Declaration

cs-api-definition
[Browsable(false)]
public event EventHandler<RadRoutedEventArgs> Hover

Event Value

EventHandler<RadRoutedEventArgs>