# Popup

The **RadNotifyIcon** allows for displaying a popup upon interacting with the icon or by manually calling the exposed methods.

## PopupContent and PopupContentTemplate

The **PopupContent** and **PopupContentTemplate** properties allow for setting the popup's content and changing its default look. Whatever is set to the **PopupContent** will be the DataContext inside the **PopupContentTemplate**. **Example 1** demonstrates how you can setup those properties.

**Example 1: Setting PopupContent and PopupContentTemplate**

```XAML
<telerik:RadNotifyIcon
x:Name="icon"
PopupContent="Hello, world!"
PopupActivationMouseEvent = "LeftClick">
    <telerik:RadNotifyIcon.PopupContentTemplate>
        <DataTemplate>
            <Border Background="Bisque">
                <TextBlock Text="{Binding}" Padding="10"/>
            </Border>
        </DataTemplate>
    </telerik:RadNotifyIcon.PopupContentTemplate>
</telerik:RadNotifyIcon>
```

> caption RadNotifyIcon with activated popup

![RadNotifyIcon with activated popup](https://www.telerik.com/products/wpf/documentation/assets/cc13bdcdaa2a8997ec1134b854286fbd/radnotifyicon_popup.png)

## PopupActivationMouseEvent

The **PopupActivationMouseEvent** property determines when the popup will be shown. The default value is **LeftClick**.

**Example 2: Setting PopupActivationMouseEvent**

```XAML
<telerik:RadNotifyIcon PopupActivationMouseEvent="LeftDoubleClick" />
```

## PopupShowDuration

The **PopupShowDuration** specifies the amount of time in **milliseconds** after which the popup will begin to close automatically. The default value is **5000** milliseconds (5s).

**Example 3: Setting PopupShowDuration**

```XAML
<telerik:RadNotifyIcon PopupShowDuration="10000" />
```

## PopupCloseMode

The **PopupCloseMode** is a bitwise enumeration, which controls the actions that will close the popup. The possible values are:

* **None**: The popup can only be closed in code (with the **HidePopup** method) or by clicking on the notify icon.
* **Deactivate**: The popup can be closed by clicking outside of it or by deactivating it with a windows keyboard shortcut.
* **Timeout**: The popup will be closed after the time specified by the **PopupShowDuration** runs out. This is the default value.

**Example 4: Closing the popup on deactivation or timeout**

```XAML
<telerik:RadNotifyIcon PopupCloseMode="Deactivate, TimeOut"  />
```

## Programmatically Showing the Popup

The RadNotifyIcon allows for programmatically showing a popup through the **ShowPopup** method. It exposes one overload, which provides the option of specifying a screen location.

* **void ShowPopup()**: Shows the popup on top of the notify icon.
* **void ShowPopup(Point location)**: Shows the popup at the provided location.

  **Example 5: Using the ShowPopup method**

  ```C#

  this.icon.ShowPopup();
  ```

  ```VB.NET

      Me.icon.ShowPopup()
  ```

## Programmatically Hiding the Popup

You can manually hide the popup with the **HidePopup** method as shown in **Example 6**.

**Example 6: Using the HidePopup method**

```C#

this.icon.HidePopup();
```

```VB.NET

Me.icon.HidePopup()
```

## Popup animations

You can control the opening and closing animation with the **PopupShowAnimation** and **PopupHideAnimation** properties respectively. They expect an animation of type [RadAnimation](https://docs.telerik.com/devtools/wpf/api/telerik.windows.controls.animation.radanimation) and by default [FadeAnimations](https://docs.telerik.com/devtools/wpf/api/telerik.windows.controls.animation.fadeanimation) are used.

**Example 7: Setting PopupShowAnimation and PopupHideAnimation**

```XAML
<Grid>
    <Grid.Resources>
        <telerik:ScaleAnimation x:Key="showAnimation" MinScale="0.1" MaxScale="0.9" Duration="00:00:02" />
        <telerik:ScaleAnimation x:Key="hideAnimation" MinScale="0.9" MaxScale="0.1" Duration="00:00:02" />
    </Grid.Resources>
    <telerik:RadNotifyIcon
    x:Name="icon2"
    PopupContent="Hello, world!"
    PopupActivationMouseEvent = "LeftDoubleClick"
    PopupShowAnimation="{StaticResource showAnimation}"
    PopupHideAnimation="{StaticResource hideAnimation}">
        <telerik:RadNotifyIcon.PopupContentTemplate>
            <DataTemplate>
                <Border Background="Bisque">
                    <TextBlock Text="{Binding}" Padding="10"/>
                </Border>
            </DataTemplate>
        </telerik:RadNotifyIcon.PopupContentTemplate>
    </telerik:RadNotifyIcon>
</Grid>
```

## IsPopupOpen

The **IsPopupOpen** property allows you to check whether a popup is currently open.

**Example 8: Using IsPopupOpen**

```C#
var isOpen = this.icon.IsPopupOpen;
```

```VB.NET
Dim isOpen = Me.icon.IsPopupOpen
```

## See Also

* [Events](https://www.telerik.com/products/wpf/documentation/controls/radnotifyicon/events)
* [Tooltip](https://www.telerik.com/products/wpf/documentation/controls/radnotifyicon/features/tooltip)
* [ContextMenu](https://www.telerik.com/products/wpf/documentation/controls/radnotifyicon/features/contextmenu)
* [Balloon Notifications](https://www.telerik.com/products/wpf/documentation/controls/radnotifyicon/features/balloon-notifications)
