Editare

Partajați prin


TaskbarItemInfo.ThumbnailClipMargin Property

Definition

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

public:
 property System::Windows::Thickness ThumbnailClipMargin { System::Windows::Thickness get(); void set(System::Windows::Thickness value); };
public System.Windows.Thickness ThumbnailClipMargin { get; set; }
member this.ThumbnailClipMargin : System.Windows.Thickness with get, set
Public Property ThumbnailClipMargin As Thickness

Property Value

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.

Examples

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>

Remarks

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

Applies to