ThumbButtonInfo Class

Definition

表示有关如何在 Windows 7 任务栏缩略图中显示按钮的信息。Represents information about how to display a button in the Windows 7 taskbar thumbnail.

public ref class ThumbButtonInfo sealed : System::Windows::Freezable, System::Windows::Input::ICommandSource
public sealed class ThumbButtonInfo : System.Windows.Freezable, System.Windows.Input.ICommandSource
type ThumbButtonInfo = class
    inherit Freezable
    interface ICommandSource
Public NotInheritable Class ThumbButtonInfo
Inherits Freezable
Implements ICommandSource
Inheritance
Implements

Examples

下面的示例演示了如何在标记中创建 ThumbButtonInfoThe following example shows how to create a ThumbButtonInfo in markup. TaskbarItemInfo 包含 ThumbButtonInfo 对象的集合,这些对象提供对任务栏项中的播放和停止命令的访问。The TaskbarItemInfo contains a collection of ThumbButtonInfo objects that provide access to the Play and Stop commands from the taskbar item. 此示例是为 TaskbarItemInfo 类提供的更大示例的一部分。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

Windows 7Windows 7 任务栏提供了增强的功能,使您可以使用任务栏按钮向用户传达状态,并在窗口最小化或隐藏时公开常见任务。The Windows 7Windows 7 taskbar provides enhanced functionality that enables you to use the taskbar button to communicate status to a user and expose common tasks when the window is minimized or hidden. 您可以向任务栏缩略图添加按钮,以提供对常见任务的访问,而无需切换到应用程序窗口。You can add buttons to the taskbar thumbnail to provide access to common tasks without switching to the application window. 例如,Windows Media Player 提供播放、暂停、前进和后退按钮,你可以在应用程序被最小化时使用这些按钮来控制任务栏缩略图中的媒体播放。For example, Windows Media Player provides Play, Pause, Forward, and Back buttons that you can use to control media playback from the taskbar thumbnail when the application is minimized.

ThumbButtonInfo 类包含一些属性,这些属性描述 Windows 7Windows 7 shell 如何显示任务栏缩略图中的按钮。The ThumbButtonInfo class contains properties that describe how the Windows 7Windows 7 shell displays the buttons in the taskbar thumbnail. 它在本机 Windows API 周围提供托管包装。It provides a managed wrapper around the native Windows API. ThumbButtonInfo 对象包含在 TaskbarItemInfo.ThumbButtonInfos 集合中。ThumbButtonInfo objects are contained in the TaskbarItemInfo.ThumbButtonInfos collection.

在早于 Windows 7Windows 7的 Windows 版本中,增强的任务栏功能不可用。The enhanced taskbar functionality is not available in versions of Windows earlier than Windows 7Windows 7. Windows 7Windows 7中,某些功能可能不可用,具体取决于用户的设置。In Windows 7Windows 7, some functionality might not be available depending on the user's settings. 例如,启用 Windows AeroWindows Aero 时,按钮仅显示在任务栏缩略图中。For example, buttons are only shown in the taskbar thumbnail when Windows AeroWindows Aero is enabled. 您的应用程序应提供与用户交互的其他方法,这些方法与不依赖于增强任务栏功能的用户交互。Your application should provide alternate ways of interacting with the user that are not dependent on the enhanced taskbar functionality.

下图显示了具有两个拇指按钮的任务栏预览,它们提供对播放和停止命令的访问。The following illustration shows a taskbar preview with two thumb buttons that provide access to the Play and Stop commands.

任务栏项信息示例Taskbar Item Info Sample
Windows 任务栏拇指按钮Windows Taskbar Thumb Buttons

Constructors

ThumbButtonInfo()

初始化 ThumbButtonInfo 类的新实例。Initializes a new instance of the ThumbButtonInfo class.

Fields

CommandParameterProperty

标识 CommandParameter 依赖项属性。Identifies the CommandParameter dependency property.

CommandProperty

标识 Command 依赖项属性。Identifies the Command dependency property.

CommandTargetProperty

标识 CommandTarget 依赖项属性。Identifies the CommandTarget dependency property.

DescriptionProperty

标识 Description 依赖项属性。Identifies the Description dependency property.

DismissWhenClickedProperty

标识 DismissWhenClicked 依赖项属性。Identifies the DismissWhenClicked dependency property.

ImageSourceProperty

标识 ImageSource 依赖项属性。Identifies the ImageSource dependency property.

IsBackgroundVisibleProperty

标识 IsBackgroundVisible 依赖项属性。Identifies the IsBackgroundVisible dependency property.

IsEnabledProperty

标识 IsEnabled 依赖项属性。Identifies the IsEnabled dependency property.

IsInteractiveProperty

标识 IsInteractive 依赖项属性。Identifies the IsInteractive dependency property.

VisibilityProperty

标识 Visibility 依赖项属性。Identifies the Visibility dependency property.

Properties

CanFreeze

获取一个值,该值指示是否可将对象变为不可修改。Gets a value that indicates whether the object can be made unmodifiable.

(Inherited from Freezable)
Command

获取或设置在单击此缩略图按钮时要调用的命令。Gets or sets the command to invoke when this thumbnail button is clicked.

CommandParameter

获取或设置要传递给 Command 属性的参数。Gets or sets the parameter to pass to the Command property.

CommandTarget

获取或设置要引发指定命令的元素。Gets or sets the element on which to raise the specified command.

DependencyObjectType

获取对此实例的 CLRCLR 类型进行包装的 DependencyObjectTypeGets the DependencyObjectType that wraps the CLRCLR type of this instance.

(Inherited from DependencyObject)
Description

获取或设置要为缩略图按钮工具提示显示的文本。Gets or sets the text to display for the thumbnail button tooltip.

DismissWhenClicked

获取或设置一个值,该值指示在单击缩略图按钮时任务栏缩略图是否关闭。Gets or sets a value that indicates whether the taskbar thumbnail closes when the thumbnail button is clicked.

Dispatcher

获取与此 Dispatcher 关联的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
ImageSource

获取或设置在缩略图按钮上显示的图像。Gets or sets the image that is displayed on the thumbnail button.

IsBackgroundVisible

获取或设置一个值,该值指示在缩略图按钮周围是否突出显示边框。Gets or sets a value that indicates whether a border and highlight is displayed around the thumbnail button.

IsEnabled

获取或设置一个值,该值指示是否启用缩略图按钮。Gets or sets a value that indicates whether the thumbnail button is enabled.

IsFrozen

获取一个值,该值指示对象当前是否可修改。Gets a value that indicates whether the object is currently modifiable.

(Inherited from Freezable)
IsInteractive

获取或设置一个值,该值指示用户是否可以与缩略图按钮进行交互。Gets or sets a value that indicates whether the user can interact with the thumbnail button.

IsSealed

获取一个值,该值指示此实例当前是否为密封的(只读)。Gets a value that indicates whether this instance is currently sealed (read-only).

(Inherited from DependencyObject)
Visibility

获取或设置一个值,该值指定缩略图按钮的显示状态。Gets or sets a value that specifies the display state of the thumbnail button.

Methods

CheckAccess()

确定调用线程是否可以访问此 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
ClearValue(DependencyProperty)

清除属性的本地值。Clears the local value of a property. 要清除的属性由 DependencyProperty 标识符指定。The property to be cleared is specified by a DependencyProperty identifier.

(Inherited from DependencyObject)
ClearValue(DependencyPropertyKey)

清除只读属性的本地值。Clears the local value of a read-only property. 要清除的属性由 DependencyPropertyKey 指定。The property to be cleared is specified by a DependencyPropertyKey.

(Inherited from DependencyObject)
Clone()

创建 Freezable 的可修改克隆,以制作该对象值的深层副本。Creates a modifiable clone of the Freezable, making deep copies of the object's values. 在复制此对象的依赖属性时,此方法会复制表达式(可能不再解析),但不复制动画或其当前值。When copying the object's dependency properties, this method copies expressions (which might no longer resolve) but not animations or their current values.

(Inherited from Freezable)
CloneCore(Freezable)

使用基(未经过动画处理的)属性值使该实例成为指定 Freezable 的克隆(深层复制)。Makes the instance a clone (deep copy) of the specified Freezable using base (non-animated) property values.

(Inherited from Freezable)
CloneCurrentValue()

使用 Freezable 的当前值创建其可修改复本(深层副本)。Creates a modifiable clone (deep copy) of the Freezable using its current values.

(Inherited from Freezable)
CloneCurrentValueCore(Freezable)

使用当前属性值使该实例成为指定 Freezable 的可修改克隆(深层复制)。Makes the instance a modifiable clone (deep copy) of the specified Freezable using current property values.

(Inherited from Freezable)
CoerceValue(DependencyProperty)

对指定依赖属性的值进行强制。Coerces the value of the specified dependency property. 通过对调用方 DependencyObject 上存在的依赖属性的属性元数据中所指定的任何 CoerceValueCallback 函数进行调用来完成此操作。This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

(Inherited from DependencyObject)
CreateInstance()

初始化 Freezable 类的新实例。Initializes a new instance of the Freezable class.

(Inherited from Freezable)
CreateInstanceCore()

在派生类中实现时,创建 Freezable 派生类的新实例。When implemented in a derived class, creates a new instance of the Freezable derived class.

(Inherited from Freezable)
Equals(Object)

确定提供的 DependencyObject 是否等效于当前 DependencyObjectDetermines whether a provided DependencyObject is equivalent to the current DependencyObject.

(Inherited from DependencyObject)
Freeze()

使当前对象不可修改,并且将其 IsFrozen 属性设置为 trueMakes the current object unmodifiable and sets its IsFrozen property to true.

(Inherited from Freezable)
FreezeCore(Boolean)

使 Freezable 对象变为不可修改或测试是否可将其变为不可修改。Makes the Freezable object unmodifiable or tests whether it can be made unmodifiable.

(Inherited from Freezable)
GetAsFrozen()

使用基(未经过动画处理的)属性值创建 Freezable 的冻结副本。Creates a frozen copy of the Freezable, using base (non-animated) property values. 由于副本已冻结,因此将通过引用复制任何冻结的子对象。Because the copy is frozen, any frozen sub-objects are copied by reference.

(Inherited from Freezable)
GetAsFrozenCore(Freezable)

让该实例成为指定的 Freezable 的冻结克隆,前者使用基(非动画的)属性值。Makes the instance a frozen clone of the specified Freezable using base (non-animated) property values.

(Inherited from Freezable)
GetCurrentValueAsFrozen()

使用当前属性值创建 Freezable 的冻结副本。Creates a frozen copy of the Freezable using current property values. 由于副本已冻结,因此将通过引用复制任何冻结的子对象。Because the copy is frozen, any frozen sub-objects are copied by reference.

(Inherited from Freezable)
GetCurrentValueAsFrozenCore(Freezable)

使当前实例成为指定 Freezable 的冻结克隆。Makes the current instance a frozen clone of the specified Freezable. 如果对象具有动画依赖属性,则复制其当前的动画值。If the object has animated dependency properties, their current animated values are copied.

(Inherited from Freezable)
GetHashCode()

获取此 DependencyObject 的哈希代码。Gets a hash code for this DependencyObject.

(Inherited from DependencyObject)
GetLocalValueEnumerator()

创建一个专用的枚举数,用于确定哪些依赖项属性在此 DependencyObject 上具有以本地方式设置的值。Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

(Inherited from DependencyObject)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
GetValue(DependencyProperty)

DependencyObject 的此实例返回依赖属性的当前有效值。Returns the current effective value of a dependency property on this instance of a DependencyObject.

(Inherited from DependencyObject)
InvalidateProperty(DependencyProperty)

重新评估指定依赖属性的有效值。Re-evaluates the effective value for the specified dependency property.

(Inherited from DependencyObject)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
OnChanged()

修改当前 Freezable 对象时调用。Called when the current Freezable object is modified.

(Inherited from Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject)

确保为刚刚设置的 DependencyObjectType 数据成员建立适当的上下文指针。Ensures that appropriate context pointers are established for a DependencyObjectType data member that has just been set.

(Inherited from Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty)

此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

(Inherited from Freezable)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

重写 OnPropertyChanged(DependencyPropertyChangedEventArgs)DependencyObject 实现,以同时调用任何响应类型 Freezable 不断变化的依赖属性的 Changed 处理程序。Overrides the DependencyObject implementation of OnPropertyChanged(DependencyPropertyChangedEventArgs) to also invoke any Changed handlers in response to a changing dependency property of type Freezable.

(Inherited from Freezable)
ReadLocalValue(DependencyProperty)

如果存在,则返回依赖属性的本地值。Returns the local value of a dependency property, if it exists.

(Inherited from DependencyObject)
ReadPreamble()

确保正在从有效的线程访问 FreezableEnsures that the Freezable is being accessed from a valid thread. Freezable 的继承者必须在任何 API 一开始读取不属于依赖项对象的数据成员时调用此方法。Inheritors of Freezable must call this method at the beginning of any API that reads data members that are not dependency properties.

(Inherited from Freezable)
SetCurrentValue(DependencyProperty, Object)

设置依赖属性的值而不更改其值源。Sets the value of a dependency property without changing its value source.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object)

设置依赖属性的本地值,该值由其依赖属性标识符指定。Sets the local value of a dependency property, specified by its dependency property identifier.

(Inherited from DependencyObject)
SetValue(DependencyPropertyKey, Object)

设置一个只读依赖属性的本地值,该值由依赖属性的 DependencyPropertyKey 标识符指定。Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property.

(Inherited from DependencyObject)
ShouldSerializeProperty(DependencyProperty)

返回一个值,该值指示序列化进程是否应序列化所提供的依赖属性的值。Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

(Inherited from DependencyObject)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess()

强制调用线程具有此 DispatcherObject 的访问权限。Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
WritePostscript()

引发 FreezableChanged 事件并调用其 OnChanged() 方法。Raises the Changed event for the Freezable and invokes its OnChanged() method. Freezable 派生的类应在修改的类成员不存储为依赖属性的任何 API 的末尾调用此方法。Classes that derive from Freezable should call this method at the end of any API that modifies class members that are not stored as dependency properties.

(Inherited from Freezable)
WritePreamble()

验证 Freezable 是否未被冻结,并且是否正在从有效的线程上下文中访问它。Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. Freezable 的继承项应当在任何 API 一开始写入不属于依赖项属性的数据成员时调用此方法。Freezable inheritors should call this method at the beginning of any API that writes to data members that are not dependency properties.

(Inherited from Freezable)

Events

Changed

在修改 Freezable 或其包含的对象时发生。Occurs when the Freezable or an object it contains is modified.

(Inherited from Freezable)
Click

在单击缩略图按钮时发生。Occurs when the thumbnail button is clicked.

Applies to

See also