ClassRadDesktopAlert
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
RadDesktopAlert()
Initializes a new instance of the RadDesktopAlert class.
Declaration
public RadDesktopAlert()
Fields
CanAutoCloseProperty
Identifies the CanAutoClose dependency property.
Declaration
public static readonly DependencyProperty CanAutoCloseProperty
Field Value
DependencyProperty
CanMoveProperty
Identifies the CanMove dependency property.
Declaration
public static readonly DependencyProperty CanMoveProperty
Field Value
DependencyProperty
ClickEvent
Identifies the Click routed event.
Declaration
public static readonly RoutedEvent ClickEvent
Field Value
RoutedEvent
ClosedEvent
Identifies the Closed routed event.
Declaration
public static readonly RoutedEvent ClosedEvent
Field Value
RoutedEvent
CommandParameterProperty
Identifies the CommandParameter dependency property.
Declaration
public static readonly DependencyProperty CommandParameterProperty
Field Value
DependencyProperty
CommandProperty
Identifies the Command dependency property.
Declaration
public static readonly DependencyProperty CommandProperty
Field Value
DependencyProperty
CommandTargetProperty
Identifies the CommandTarget property.
Declaration
public static readonly DependencyProperty CommandTargetProperty
Field Value
DependencyProperty
IconColumnWidthProperty
Identifies the IconColumnWidth dependency property.
Declaration
public static readonly DependencyProperty IconColumnWidthProperty
Field Value
DependencyProperty
IconMarginProperty
Identifies the IconMargin dependency property.
Declaration
public static readonly DependencyProperty IconMarginProperty
Field Value
DependencyProperty
IconProperty
Identifies the Icon property.
Declaration
public static readonly DependencyProperty IconProperty
Field Value
DependencyProperty
IconTemplateProperty
Identifies the IconTemplate dependency property.
Declaration
public static readonly DependencyProperty IconTemplateProperty
Field Value
DependencyProperty
IsHostedInDefaultWindowProperty
Identifies the IsHostedInDefaultWindow Property.
Declaration
public static readonly DependencyProperty IsHostedInDefaultWindowProperty
Field Value
DependencyProperty
IsMenuOpenProperty
Identifies the IsMenuOpen dependency property.
Declaration
public static readonly DependencyProperty IsMenuOpenProperty
Field Value
DependencyProperty
IsMouseOverAlertProperty
Identifies the IsMouseOverAlert Property.
Declaration
public static readonly DependencyProperty IsMouseOverAlertProperty
Field Value
DependencyProperty
MenuItemContainerStyleProperty
Identifies the MenuItemContainerStyle dependency property.
Declaration
public static readonly DependencyProperty MenuItemContainerStyleProperty
Field Value
DependencyProperty
MenuItemsSourceProperty
Identifies the MenuItemsSource dependency property.
Declaration
public static readonly DependencyProperty MenuItemsSourceProperty
Field Value
DependencyProperty
ShowCloseButtonProperty
Identifies the ShowCloseButton dependency property.
Declaration
public static readonly DependencyProperty ShowCloseButtonProperty
Field Value
DependencyProperty
ShowDurationProperty
Identifies the ShowDuration dependency property.
Declaration
public static readonly DependencyProperty ShowDurationProperty
Field Value
DependencyProperty
ShowInTaskSwitcherProperty
Identifies the ShowInTaskSwitcher dependency property.
Declaration
public static readonly DependencyProperty ShowInTaskSwitcherProperty
Field Value
DependencyProperty
ShowMenuButtonProperty
Identifies the ShowMenuButton dependency property.
Declaration
public static readonly DependencyProperty ShowMenuButtonProperty
Field Value
DependencyProperty
SoundProperty
Identifies the Sound dependency property.
Declaration
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
public bool CanAutoClose { get; set; }
Property Value
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
public bool CanMove { get; set; }
Property Value
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
[TypeConverter(typeof(CommandConverter))]
public ICommand Command { get; set; }
Property Value
CommandParameter
Represents a user defined data value that can be passed to the command when it is executed.
CommandTarget
The object that the command is being executed on.
Declaration
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
[SRCategory("Appearance")]
public object Icon { get; set; }
Property Value
IconColumnWidth
Gets or sets the width of the column that contains the icon area. This is a dependency property.
Declaration
[SRCategory("Appearance")]
public double IconColumnWidth { get; set; }
Property Value
IconMargin
Gets or sets the margin of the icon of RadDesktopAlert. This is a dependency property.
Declaration
[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
[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.
IsMenuOpen
Gets or sets the value that indicates whether the RadDesktopAlert drop-down menu is currently open. This is a dependency property.
IsMouseOverAlert
Gets a value indicating whether the mouse pointer is located over RadDesktopAlert.
MenuItemContainerStyle
Gets or sets the Style that is applied to the container element generated for each item of RadDesktopAlert drop-down menu.
Declaration
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
public IEnumerable MenuItemsSource { get; set; }
Property Value
ShowCloseButton
Gets or sets a boolean value determining whether the Close button of RadDesktopAlert will be visible. This is a dependency property.
Declaration
public bool ShowCloseButton { get; set; }
Property Value
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.
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
public bool ShowInTaskSwitcher { get; set; }
Property Value
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
public bool ShowMenuButton { get; set; }
Property Value
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
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
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
protected virtual void OnClick()
OnClosed()
Called when the alert is closed and raises a Closed event.
Declaration
protected virtual void OnClosed()
OnCreateAutomationPeer()
Creates a RadDesktopAlertAutomationPeer.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
OnInitialized(EventArgs)
Raises the event. This method is invoked whenever is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
The RoutedEventArgs that contains the event data.
OnMenuClosed(EventArgs)
Raises the event.
OnMenuOpened(EventArgs)
Raises the event.
OnMouseEnter(MouseEventArgs)
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
e
MouseEventArgs
OnMouseLeave(MouseEventArgs)
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
e
MouseEventArgs
OnMouseLeftButtonUp(MouseButtonEventArgs)
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
e
MouseButtonEventArgs
PlaySound()
Called when the alert is just shown and the sound can be played.
Declaration
protected virtual void PlaySound()
Events
Click
Occurs when a RadDesktopAlert is clicked.
Declaration
[SRCategory("Behavior")]
public event RadRoutedEventHandler Click
Event Value
Closed
Occurs when a RadDesktopAlert is closed.
Declaration
[SRCategory("Behavior")]
public event RadRoutedEventHandler Closed
Event Value
MenuClosed
Occurs when the drop-down menu of the RadDesktopAlert closes.
Declaration
[SRCategory("Behavior")]
public event EventHandler MenuClosed
Event Value
MenuOpened
Occurs when the drop-down menu of the RadDesktopAlert opens.
Declaration
[SRCategory("Behavior")]
public event EventHandler MenuOpened
Event Value