Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TaskbarItemInfo.ThumbnailClipMargin Property

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)
XMLNS for XAML: Not mapped to an xmlns.
member ThumbnailClipMargin : Thickness with get, set

<object>
  <object.ThumbnailClipMargin>
    <Thickness .../>
  </object.ThumbnailClipMargin>
</object>
<object ThumbnailClipMargin="Thickness" .../>

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 Border

Thumbnail clip margin

The following illustration shows the clipped thumbnail preview.

Windows Taskbar Thumbnail Preview

Taskbar Item Info Sample

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

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.