# Key Properties

The purpose of this help article is to show you the key properties of **RadDesktopAlert** control. The topic includes the following properties:

* [Header](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#header)
* [Content](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#content)
* [ShowDuration](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#showduration)
* [Icon](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#icon)
* [IconColumnWidth](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#iconcolumnwidth)
* [IconMargin](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#iconmargin)
* [Command](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#command)
* [CanAutoClose ](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#canautoclose)
* [ShowCloseButton](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#showclosebutton)
* [ShowMenuButton](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#showmenubutton)
* [ShowInTaskSwitcher](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/desktopalert-key-properties#showintaskswitcher)

## Header

The **Header** property is used to set the header content of **RadDesktopAlert**. The **Header** is of type object, so by applying a custom **HeaderTemplate** as well any desired content can be visualized.

**Example 1: Setting Header**

```C#
var alert = new RadDesktopAlert();
alert.Header = "Mail Notification";
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.Header = "Mail Notification"
```

## Content

Using the **Content** property the inner content of **RadDesktopAlert** could easily be set. The **Content** property is of type object, so any content can be visualized by applying a custom **ContentTemplate**.

**Example 2: Setting Content**

```C#
var alert = new RadDesktopAlert();
alert.Content = "Hello, Here are two things that we noticed today on our front-end meeting";
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.Content = "Hello, Here are two things that we noticed today on our front-end meeting"
```

## ShowDuration

The duration of the visualization of **RadDesktopAlert** is determined by the **ShowDuration** property of the control. It is of type integer and represents the amount of milliseconds after which the alert automatically closes. The default value of the property is 5000.

**Example 3: Setting ShowDuration**

```C#
var alert = new RadDesktopAlert();
alert.ShowDuration = 3000;
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.ShowDuration = 3000
```

## Icon

In order to display an icon inside **RadDesktopAlert** the **Icon** property should be set. It is of type object, so any content can be visualized by applying a custom **IconTemplate** as well. The following example demonstrates how to show the built in icon image of the currently used theme:

**Example 4: Setting Icon**

```C#
var alert = new RadDesktopAlert();
// the "DesktopAlertIcon" in the example below points to a Telerik's ImageSource resource defined in the XAML, similar to this: <ImageSource x:Key="DesktopAlertIcon">pack://application:,,,/Telerik.Windows.Controls.Navigation;component/Themes/Images/DesktopAlertIconFlatBlack.png</ImageSource>
ImageSource icon = Application.Current.FindResource("DesktopAlertIcon") as ImageSource;
alert.Icon = new Image { Source = icon, Width = 48, Height = 48 };
```

```VB.NET
Dim alert = New RadDesktopAlert()
	'the "DesktopAlertIcon" in the example below points to a Telerik's ImageSource resource defined in the XAML, similar to this: <ImageSource x:Key="DesktopAlertIcon">pack://application:,,,/Telerik.Windows.Controls.Navigation;component/Themes/Images/DesktopAlertIconFlatBlack.png</ImageSource>
 	Dim icon = TryCast(Application.Current.FindResource("DesktopAlertIcon"), ImageSource)
alert.Icon = New Image() With
{
    .Source = icon,
    .Width = 48,
    .Height = 48
}
```

## IconColumnWidth

Using the **IconColumnWidth** property you could easily set the Width of the column that contains the icon. The default value is double.NaN, so the property needs to be set always to the needed value if an icon is used.

**Example 5: Setting IconColumnWidth**

```C#
var alert = new RadDesktopAlert();
alert.IconColumnWidth = 75;
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.IconColumnWidth = 75
```

## IconMargin

The **IconMargin** property is a specific property of **RadDesktopAlert** that is used to set a Margin around the control's icon. By default there aren't any margins applied.

**Example 6: Setting IconMargin**

```C#
var alert = new RadDesktopAlert();
alert.IconMargin = new Thickness(0, 0, 10, 10);
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.IconMargin = New Thickness(0, 0, 10, 10)
```

## Command

**RadDesktopAlert** provides you with a command property. This means you can bind the alert to a command that will be executed when it gets clicked.

**Example 7: Setting Command**

```C#
var alert = new RadDesktopAlert();
alert.Command = new DelegateCommand(this.OnCommandExecuted);
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.Command = New DelegateCommand(Me.OnCommandExecuted)
```

## CanAutoClose

In order to prevent **RadDesktopAlert** from auto closing you need to use the **CanAutoClose** property introduced with Q3 2015 release version of UI for WPF. It is of type bool so it could either be set to True, False – the default value is true:

**Example 8: Setting CanAutoClose**

```C#
var alert = new RadDesktopAlert();
alert.CanAutoClose = true;
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.CanAutoClose = True
```

The **CanAutoClose** property could also be set using the **DesktopAlertParameters** that are passed to the **ShowAlert** method of **RadDesktopAlertManager**:

**Example 9: Setting CanAutoClose using DesktopAlertParameters**

```C#
var manager = new RadDesktopAlertManager();
manager.ShowAlert(new DesktopAlertParameters
{
    CanAutoClose = false,
    Header = "Message",
    Content = "A new message has arrived!"
});
```

```VB.NET
Dim manager = New RadDesktopAlertManager()
manager.ShowAlert(New DesktopAlertParameters With
{
    .CanAutoClose = False,
    .Header = "Message",
    .Content = "A new message has arrived!"
})
```

## ShowCloseButton

You could easily hide the close button of **RadDesktopAlert** using the **ShowCloseButton**. By setting it to **False** the button will get hide - be default it is  true. This property was introduced with Q3 2015 released version of UI for WPF:

**Example 10: Setting ShowCloseButton**

```C#
var alert = new RadDesktopAlert();
alert.ShowCloseButton = false;
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.ShowCloseButton = False
```

## ShowMenuButton

In order to visualize the menu of **RadDesktopAlert** you need to set the **ShowMenuButton** property to true – by default it is set to false. By doing so a **DropDownButton** will be visualized next to the close button and an empty menu with no items will be created. This property was introduced with Q3 2015 released version of UI for WPF:

**Example 11: Setting ShowMenuButton**

```C#
var alert = new RadDesktopAlert();
alert.ShowMenuButton = false;
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.ShowMenuButton = False
```

## ShowInTaskSwitcher

By the default the **RadDesktopAlert** window will appear in the TaskSwitcher (Alt+Tab menu). To hide it from this menu, you need to set the **ShowInTaskSwitcher** property to false. The default value is **true**.

**Example 12: Setting ShowInTaskSwitcher**

```C#
var alert = new RadDesktopAlert();
alert.ShowInTaskSwitcher = false;
```

```VB.NET
Dim alert = New RadDesktopAlert()
alert.ShowInTaskSwitcher = False
```

## See Also

* [Overview](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/overview)
* [Getting Started](https://www.telerik.com/products/wpf/documentation/controls/raddesktopalert/getting-started)
