Class
RadDesktopAlert

Represents a customizable desktop alert notification that can display information to the user through various properties and events. The RadDesktopAlert can be configured to automatically close after a specified duration, can include an icon, and offers options for showing close and menu buttons. Users can interact with the alert—clicking it raises a click event, while the presence of a command enables the invocation of predefined methods. Furthermore, it supports appearing in the Task Switcher and can display a dropdown menu, providing a flexible way to present alerts within a desktop application.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Navigation.dll

Syntax:

cs-api-definition
[TelerikToolboxCategory("Containers")]
public class RadDesktopAlert : HeaderedContentControl, ICommandSource

Inheritance: objectRadDesktopAlert

Implements: ICommandSource

Constructors

RadDesktopAlert()

Initializes a new instance of the RadDesktopAlert class.

Declaration

cs-api-definition
public RadDesktopAlert()

Fields

CanAutoCloseProperty

Identifies the CanAutoClose dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanAutoCloseProperty

Field Value

DependencyProperty

CanMoveProperty

Identifies the CanMove dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanMoveProperty

Field Value

DependencyProperty

ClickEvent

Identifies the Click routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent ClickEvent

Field Value

RoutedEvent

ClosedEvent

Identifies the Closed routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent ClosedEvent

Field Value

RoutedEvent

CommandParameterProperty

Identifies the CommandParameter dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CommandParameterProperty

Field Value

DependencyProperty

CommandProperty

Identifies the Command dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CommandProperty

Field Value

DependencyProperty

CommandTargetProperty

Identifies the CommandTarget property.

Declaration

cs-api-definition
public static readonly DependencyProperty CommandTargetProperty

Field Value

DependencyProperty

IconColumnWidthProperty

Identifies the IconColumnWidth dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IconColumnWidthProperty

Field Value

DependencyProperty

IconMarginProperty

Identifies the IconMargin dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IconMarginProperty

Field Value

DependencyProperty

IconProperty

Identifies the Icon property.

Declaration

cs-api-definition
public static readonly DependencyProperty IconProperty

Field Value

DependencyProperty

IconTemplateProperty

Identifies the IconTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IconTemplateProperty

Field Value

DependencyProperty

IsHostedInDefaultWindowProperty

Identifies the IsHostedInDefaultWindow Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsHostedInDefaultWindowProperty

Field Value

DependencyProperty

IsMenuOpenProperty

Identifies the IsMenuOpen dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsMenuOpenProperty

Field Value

DependencyProperty

IsMouseOverAlertProperty

Identifies the IsMouseOverAlert Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsMouseOverAlertProperty

Field Value

DependencyProperty

MenuItemContainerStyleProperty

Identifies the MenuItemContainerStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty MenuItemContainerStyleProperty

Field Value

DependencyProperty

MenuItemsSourceProperty

Identifies the MenuItemsSource dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty MenuItemsSourceProperty

Field Value

DependencyProperty

ShowCloseButtonProperty

Identifies the ShowCloseButton dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ShowCloseButtonProperty

Field Value

DependencyProperty

ShowDurationProperty

Identifies the ShowDuration dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ShowDurationProperty

Field Value

DependencyProperty

ShowInTaskSwitcherProperty

Identifies the ShowInTaskSwitcher dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ShowInTaskSwitcherProperty

Field Value

DependencyProperty

ShowMenuButtonProperty

Identifies the ShowMenuButton dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ShowMenuButtonProperty

Field Value

DependencyProperty

SoundProperty

Identifies the Sound dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SoundProperty

Field Value

DependencyProperty

Properties

CanAutoClose

Gets or sets the value that indicates whether the RadDesktopAlert can automatically close. This is a dependency property.

Declaration

cs-api-definition
public bool CanAutoClose { get; set; }

Property Value

bool

True if this instance can automatically close; otherwise, false.

Remarks

If the value of this property is true, the instance will automatically close whenever the ShowDuration time elapses.

CanMove

Gets or sets a boolean value determining whether the RadDesktopAlert can be moved by dragging. This is a dependency property.

Declaration

cs-api-definition
public bool CanMove { get; set; }

Property Value

bool

True if this instance can be dragged; otherwise, false.

Remarks

If the value of this property is true, the instance can be dragged; otherwise it is fixed.

Command

Gets the command that will be executed when the command source is invoked.

Declaration

cs-api-definition
[TypeConverter(typeof(CommandConverter))]
public ICommand Command { get; set; }

Property Value

ICommand

CommandParameter

Represents a user defined data value that can be passed to the command when it is executed.

Declaration

cs-api-definition
public object CommandParameter { get; set; }

Property Value

object

CommandTarget

The object that the command is being executed on.

Declaration

cs-api-definition
public IInputElement CommandTarget { get; set; }

Property Value

IInputElement

Icon

Gets or sets the icon that appears in a RadDesktopAlert. This is a dependency property.

Declaration

cs-api-definition
[SRCategory("Appearance")]
public object Icon { get; set; }

Property Value

object

IconColumnWidth

Gets or sets the width of the column that contains the icon area. This is a dependency property.

Declaration

cs-api-definition
[SRCategory("Appearance")]
public double IconColumnWidth { get; set; }

Property Value

double

IconMargin

Gets or sets the margin of the icon of RadDesktopAlert. This is a dependency property.

Declaration

cs-api-definition
[SRCategory("Appearance")]
public Thickness IconMargin { get; set; }

Property Value

Thickness

IconTemplate

Gets or sets the data template used for Icon. This is a dependency property.

Declaration

cs-api-definition
[SRCategory("Appearance")]
public DataTemplate IconTemplate { get; set; }

Property Value

DataTemplate

IsHostedInDefaultWindow

Gets a value indicating whether the RadDesktopAlert instance is hosted in the default window.

Declaration

cs-api-definition
public bool IsHostedInDefaultWindow { get; }

Property Value

bool

IsMenuOpen

Gets or sets the value that indicates whether the RadDesktopAlert drop-down menu is currently open. This is a dependency property.

Declaration

cs-api-definition
public bool IsMenuOpen { get; set; }

Property Value

bool

IsMouseOverAlert

Gets a value indicating whether the mouse pointer is located over RadDesktopAlert.

Declaration

cs-api-definition
public bool IsMouseOverAlert { get; }

Property Value

bool

MenuItemContainerStyle

Gets or sets the Style that is applied to the container element generated for each item of RadDesktopAlert drop-down menu.

Declaration

cs-api-definition
public Style MenuItemContainerStyle { get; set; }

Property Value

Style

MenuItemsSource

Gets or sets a collection used to generate the content of RadDesktopAlert drop-down menu.

Declaration

cs-api-definition
public IEnumerable MenuItemsSource { get; set; }

Property Value

IEnumerable

ShowCloseButton

Gets or sets a boolean value determining whether the Close button of RadDesktopAlert will be visible. This is a dependency property.

Declaration

cs-api-definition
public bool ShowCloseButton { get; set; }

Property Value

bool

True if the Close button is visible; false otherwise.

Remarks

If the value of this property is true, the Close button is visible; otherwise is hidden.

ShowDuration

Gets or sets the amount of time in milliseconds after which RadDesktopAlert will be automatically closed. This is a dependency property.

Declaration

cs-api-definition
public int ShowDuration { get; set; }

Property Value

int

ShowInTaskSwitcher

Gets or sets a boolean value determining whether the RadDesktopAlert would be visible in the Task Switcher (Alt+Tab) menu of the Windows. The default value is true. This is a dependency property.

Declaration

cs-api-definition
public bool ShowInTaskSwitcher { get; set; }

Property Value

bool

Remarks

If the value of this property is true, the instance won't be hidden; otherwise would be hidden.

ShowMenuButton

Gets or sets a boolean value determining whether the Menu button of RadDesktopAlert will be visible. This is a dependency property.

Declaration

cs-api-definition
public bool ShowMenuButton { get; set; }

Property Value

bool

True if the Menu button is visible; false otherwise.

Remarks

If the value of this property is true, the Menu button is visible; otherwise is hidden.

Sound

Gets or sets the system sound that will be played when the alert is shown. This is a dependency property.

Declaration

cs-api-definition
public SystemSound Sound { get; set; }

Property Value

SystemSound

Methods

OnApplyTemplate()

Called when the control is applying its template. This method is responsible for initializing the visual elements and setting up the necessary bindings and properties after the control's template has been applied.

Declaration

cs-api-definition
public override void OnApplyTemplate()

Remarks

This method overrides the OnApplyTemplate method of the base class to provide specific functionality for the RadDesktopAlert control.

OnClick()

Called when the content of the alert is clicked and raises a Click event.

Declaration

cs-api-definition
protected virtual void OnClick()

OnClosed()

Called when the alert is closed and raises a Closed event.

Declaration

cs-api-definition
protected virtual void OnClosed()

OnCreateAutomationPeer()

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

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.

OnMenuClosed(EventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnMenuClosed(EventArgs e)

Parameters

e

EventArgs

The EventArgs instance containing the event data.

OnMenuOpened(EventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnMenuOpened(EventArgs e)

Parameters

e

EventArgs

The EventArgs instance containing the event data.

OnMouseEnter(MouseEventArgs)

Declaration

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

Parameters

e

MouseEventArgs

OnMouseLeave(MouseEventArgs)

Declaration

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

Parameters

e

MouseEventArgs

OnMouseLeftButtonUp(MouseButtonEventArgs)

Declaration

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

Parameters

e

MouseButtonEventArgs

PlaySound()

Called when the alert is just shown and the sound can be played.

Declaration

cs-api-definition
protected virtual void PlaySound()

ResetTheme()

Resets the theme.

Declaration

cs-api-definition
public void ResetTheme()

Events

Click

Occurs when a RadDesktopAlert is clicked.

Declaration

cs-api-definition
[SRCategory("Behavior")]
public event RadRoutedEventHandler Click

Event Value

RadRoutedEventHandler

Closed

Occurs when a RadDesktopAlert is closed.

Declaration

cs-api-definition
[SRCategory("Behavior")]
public event RadRoutedEventHandler Closed

Event Value

RadRoutedEventHandler

MenuClosed

Occurs when the drop-down menu of the RadDesktopAlert closes.

Declaration

cs-api-definition
[SRCategory("Behavior")]
public event EventHandler MenuClosed

Event Value

EventHandler

MenuOpened

Occurs when the drop-down menu of the RadDesktopAlert opens.

Declaration

cs-api-definition
[SRCategory("Behavior")]
public event EventHandler MenuOpened

Event Value

EventHandler