Share via


ThumbButtonInfo.ImageSource 屬性

定義

取得或設定顯示在縮圖按鈕上的影像。

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

屬性值

顯示在縮圖按鈕上的影像。 預設為 null

範例

下列範例示範如何在標記中建立 ThumbButtonInfo 。 系 ThumbButtonInfo 結至 MediaCommands.Stop 命令。 按鈕影像是 XAML 中定義為靜態資源的深灰色方形。 這個範例是提供給 類別之較大範例的 TaskbarItemInfo 一部分。

<ThumbButtonInfo
    DismissWhenClicked="True"
    Command="MediaCommands.Stop"
    CommandTarget="{Binding ElementName=btnStop}"
    Description="Stop"
    ImageSource="{StaticResource ResourceKey=StopImage}"/>

備註

您可以將靜態或動畫 ImageSource 放在縮圖按鈕上。 影像會以適當的大小轉譯。 ImageSource如果 表示 Icon ,也會使用適當的位深度。

若要提供有關縮圖按鈕的其他文字資訊,請設定 Description 屬性。

適用於

另請參閱