Overlay Property
Collapse the table of content
Expand the table of content

TaskbarItemInfo.Overlay Property

.NET Framework (current version)
 

Gets or sets the image that is displayed over the program icon in the taskbar button.

Namespace:   System.Windows.Shell
Assembly:  PresentationFramework (in PresentationFramework.dll)

Public Property Overlay As ImageSource

Property Value

Type: System.Windows.Media.ImageSource

The image that is displayed over the program icon in the taskbar button. The default is null.

You can add an image to the program icon in the taskbar button to communicate application status to the user. The overlay uses a static or animated ImageSource that is positioned over the bottom-right corner of the icon in the taskbar button. The overlay is not displayed if the user sets the taskbar to show small icons.

Program icons in the notification area, which is at the far right of the taskbar, are typically used to communicate application status to a user. In Windows 7, program icons in the notification area are hidden by default, and are therefore, less useful for communicating status. You can use the taskbar button overlay in Windows 7 to communicate status when the icon in the notification area is hidden. Your application can detect the version of Windows and provide notifications in a manner that is appropriate for the operating system.

Overlay images are rendered at the appropriate size. If the ImageSource represents an Icon, the appropriate bit depth is also used.

The following illustration shows the taskbar Overlay.

Taskbar Item Info Sample

Windows Taskbar Overlay

The following example shows how to create a TaskbarItemInfo in markup and set the Overlay property. This example is part of a larger example provided for the TaskbarItemInfo class.

<Window.TaskbarItemInfo>
    <TaskbarItemInfo x:Name="taskBarItemInfo1" 
                     Overlay="{StaticResource ResourceKey=StopImage}"
                     ThumbnailClipMargin="80,0,80,140"
                     Description="Taskbar Item Info Sample">
        <TaskbarItemInfo.ThumbButtonInfos>
            <ThumbButtonInfoCollection>
                <ThumbButtonInfo
                    DismissWhenClicked="False"
                    Command="MediaCommands.Play"
                    CommandTarget="{Binding ElementName=btnPlay}"
                    Description="Play"
                    ImageSource="{StaticResource ResourceKey=PlayImage}"/>
                <ThumbButtonInfo
                    DismissWhenClicked="True"
                    Command="MediaCommands.Stop"
                    CommandTarget="{Binding ElementName=btnStop}"
                    Description="Stop"
                    ImageSource="{StaticResource ResourceKey=StopImage}"/>
            </ThumbButtonInfoCollection>
        </TaskbarItemInfo.ThumbButtonInfos>
    </TaskbarItemInfo>
</Window.TaskbarItemInfo>

The following example shows how to set the Overlay property in code.

Me.taskBarItemInfo1.Overlay = Me.FindResource("StopImage")

.NET Framework
Available since 4.0
Return to top
Show:
© 2016 Microsoft