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:
[TelerikToolboxCategory("Containers")]
public class RadDesktopAlert : HeaderedContentControl, ICommandSource
Inheritance: objectRadDesktopAlert
Implements:
Constructors
Initializes a new instance of the RadDesktopAlert class.
public RadDesktopAlert()
Fields
CanAutoCloseProperty
DependencyProperty
Identifies the CanAutoClose dependency property.
public static readonly DependencyProperty CanAutoCloseProperty
CanMoveProperty
DependencyProperty
Identifies the CanMove dependency property.
public static readonly DependencyProperty CanMoveProperty
ClickEvent
RoutedEvent
Identifies the Click routed event.
public static readonly RoutedEvent ClickEvent
ClosedEvent
RoutedEvent
Identifies the Closed routed event.
public static readonly RoutedEvent ClosedEvent
CommandParameterProperty
DependencyProperty
Identifies the CommandParameter dependency property.
public static readonly DependencyProperty CommandParameterProperty
CommandProperty
DependencyProperty
Identifies the Command dependency property.
public static readonly DependencyProperty CommandProperty
CommandTargetProperty
DependencyProperty
Identifies the CommandTarget property.
public static readonly DependencyProperty CommandTargetProperty
IconColumnWidthProperty
DependencyProperty
Identifies the IconColumnWidth dependency property.
public static readonly DependencyProperty IconColumnWidthProperty
IconMarginProperty
DependencyProperty
Identifies the IconMargin dependency property.
public static readonly DependencyProperty IconMarginProperty
IconProperty
DependencyProperty
Identifies the Icon property.
public static readonly DependencyProperty IconProperty
IconTemplateProperty
DependencyProperty
Identifies the IconTemplate dependency property.
public static readonly DependencyProperty IconTemplateProperty
IsHostedInDefaultWindowProperty
DependencyProperty
Identifies the IsHostedInDefaultWindow Property.
public static readonly DependencyProperty IsHostedInDefaultWindowProperty
IsMenuOpenProperty
DependencyProperty
Identifies the IsMenuOpen dependency property.
public static readonly DependencyProperty IsMenuOpenProperty
IsMouseOverAlertProperty
DependencyProperty
Identifies the IsMouseOverAlert Property.
public static readonly DependencyProperty IsMouseOverAlertProperty
MenuItemContainerStyleProperty
DependencyProperty
Identifies the MenuItemContainerStyle dependency property.
public static readonly DependencyProperty MenuItemContainerStyleProperty
MenuItemsSourceProperty
DependencyProperty
Identifies the MenuItemsSource dependency property.
public static readonly DependencyProperty MenuItemsSourceProperty
ShowCloseButtonProperty
DependencyProperty
Identifies the ShowCloseButton dependency property.
public static readonly DependencyProperty ShowCloseButtonProperty
ShowDurationProperty
DependencyProperty
Identifies the ShowDuration dependency property.
public static readonly DependencyProperty ShowDurationProperty
ShowInTaskSwitcherProperty
DependencyProperty
Identifies the ShowInTaskSwitcher dependency property.
public static readonly DependencyProperty ShowInTaskSwitcherProperty
ShowMenuButtonProperty
DependencyProperty
Identifies the ShowMenuButton dependency property.
public static readonly DependencyProperty ShowMenuButtonProperty
SoundProperty
DependencyProperty
Identifies the Sound dependency property.
public static readonly DependencyProperty SoundProperty
Properties
Gets or sets the value that indicates whether the RadDesktopAlert can automatically close. This is a dependency property.
public bool CanAutoClose { get; set; }
True if this instance can automatically close; otherwise, false.
If the value of this property is true, the instance will automatically close whenever the
ShowDuration time elapses.
Gets or sets a boolean value determining whether the RadDesktopAlert can be moved by dragging. This is a dependency property.
public bool CanMove { get; set; }
True if this instance can be dragged; otherwise, false.
If the value of this property is true, the instance can be dragged; otherwise it is fixed.
Gets the command that will be executed when the command source is invoked.
[TypeConverter(typeof(CommandConverter))]
public ICommand Command { get; set; }
Represents a user defined data value that can be passed to the command when it is executed.
public object CommandParameter { get; set; }
CommandTarget
IInputElement
The object that the command is being executed on.
public IInputElement CommandTarget { get; set; }
Gets or sets the icon that appears in a RadDesktopAlert. This is a dependency property.
[SRCategory("Appearance")]
public object Icon { get; set; }
Gets or sets the width of the column that contains the icon area. This is a dependency property.
[SRCategory("Appearance")]
public double IconColumnWidth { get; set; }
IconMargin
Thickness
Gets or sets the margin of the icon of RadDesktopAlert. This is a dependency property.
[SRCategory("Appearance")]
public Thickness IconMargin { get; set; }
IconTemplate
DataTemplate
Gets or sets the data template used for Icon. This is a dependency property.
[SRCategory("Appearance")]
public DataTemplate IconTemplate { get; set; }
Gets a value indicating whether the RadDesktopAlert instance is hosted in the default window.
public bool IsHostedInDefaultWindow { get; }
Gets or sets the value that indicates whether the RadDesktopAlert drop-down menu is currently open. This is a dependency property.
public bool IsMenuOpen { get; set; }
Gets a value indicating whether the mouse pointer is located over RadDesktopAlert.
public bool IsMouseOverAlert { get; }
Gets or sets the Style that is applied to the container element generated for each item of RadDesktopAlert drop-down menu.
public Style MenuItemContainerStyle { get; set; }
Gets or sets a collection used to generate the content of RadDesktopAlert drop-down menu.
public IEnumerable MenuItemsSource { get; set; }
Gets or sets a boolean value determining whether the Close button of RadDesktopAlert will be visible. This is a dependency property.
public bool ShowCloseButton { get; set; }
True if the Close button is visible; false otherwise.
If the value of this property is true, the Close button is visible; otherwise is hidden.
Gets or sets the amount of time in milliseconds after which RadDesktopAlert will be automatically closed. This is a dependency property.
public int ShowDuration { get; set; }
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.
public bool ShowInTaskSwitcher { get; set; }
If the value of this property is true, the instance won't be hidden; otherwise would be hidden.
Gets or sets a boolean value determining whether the Menu button of RadDesktopAlert will be visible. This is a dependency property.
public bool ShowMenuButton { get; set; }
True if the Menu button is visible; false otherwise.
If the value of this property is true, the Menu button is visible; otherwise is hidden.
Sound
SystemSound
Gets or sets the system sound that will be played when the alert is shown. This is a dependency property.
public SystemSound Sound { get; set; }
Methods
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.
public override void OnApplyTemplate()
This method overrides the OnApplyTemplate method of the base class to provide specific functionality for the RadDesktopAlert control.
Called when the content of the alert is clicked and raises a Click event.
protected virtual void OnClick()
Called when the alert is closed and raises a Closed event.
protected virtual void OnClosed()
OnCreateAutomationPeer()
AutomationPeer
Creates a RadDesktopAlertAutomationPeer.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
protected override void OnMouseEnter(MouseEventArgs e)
protected override void OnMouseLeave(MouseEventArgs e)
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Called when the alert is just shown and the sound can be played.
protected virtual void PlaySound()
Resets the theme.
public void ResetTheme()
Events
Occurs when a RadDesktopAlert is clicked.
[SRCategory("Behavior")]
public event RadRoutedEventHandler Click
Occurs when a RadDesktopAlert is closed.
[SRCategory("Behavior")]
public event RadRoutedEventHandler Closed
Occurs when the drop-down menu of the RadDesktopAlert closes.
[SRCategory("Behavior")]
public event EventHandler MenuClosed
Occurs when the drop-down menu of the RadDesktopAlert opens.
[SRCategory("Behavior")]
public event EventHandler MenuOpened