TaskbarItemInfo.ThumbnailClipMargin Property

.NET Framework (current version)
 

Gets or sets a value that specifies the part of the application window's client area that is displayed in the taskbar thumbnail.

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

public Thickness ThumbnailClipMargin { get; set; }

Property Value

Type: System.Windows.Thickness

A value that specifies the part of the application window's client area that is displayed in the taskbar thumbnail. The default is an empty Thickness.

By default, the Windows 7 taskbar displays a scaled thumbnail of an application window's client area. You can set the ThumbnailClipMargin property to specify a cropped area of the client window that is displayed in the thumbnail. For example, this property is useful if you want to focus the thumbnail on the window content while you exclude the application toolbars. This property cannot be used to display content in the thumbnail that is not already visible in the application window.

You specify the area that is displayed in the thumbnail by setting the Thickness of the border around the area. The border starts at the edge of the client window and extends inward by the specified amount. Content inside the border is displayed in the thumbnail.

The following illustration shows the borders that define the ThumbnailClipMargin.

Thumbnail clip margin

Thumbnail Clip Margin Border

The following illustration shows the clipped thumbnail preview.

Taskbar Item Info Sample

Windows Taskbar Thumbnail Preview

The following example shows how to create a TaskbarItemInfo in markup and set the ThumbnailClipMargin 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>

.NET Framework
Available since 4.0
Return to top
Show: