JumpList 類別

定義

提供應用程式跳躍清單的功能。 跳躍清單是系統提供的功能表,當使用者以滑鼠右鍵按一下工作列或 [開始] 功能表上的程式時會出現。 它可用來快速存取最近或熱門檔案,並提供應用程式功能的直接連結。 並非所有裝置系列都支援跳躍清單。

public ref class JumpList sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class JumpList final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class JumpList
Public NotInheritable Class JumpList
繼承
Object Platform::Object IInspectable JumpList
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10586.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v2.0 引進)

範例

下列範例示範如何移除應用程式的跳躍清單,包括可能先前新增的任何自訂專案。

private async void DisableSystemJumpListAsync()
{
    // Get the app's jump list.
    var jumpList = await Windows.UI.StartScreen.JumpList.LoadCurrentAsync();

    // Disable the system-managed jump list group.
    jumpList.SystemGroupKind = Windows.UI.StartScreen.JumpListSystemGroupKind.None;

    // Remove any previously added custom jump list items.
    jumpList.Items.Clear();

    // Save the changes to the app's jump list.
    await jumpList.SaveAsync();
}

下列範例示範如何設定應用程式跳躍清單所使用的系統管理群組類型,而不會影響任何現有的自訂跳躍清單專案。

private async void SetSystemGroupAsync()
{
    // Get the app's jump list.
    var jumpList = await Windows.UI.StartScreen.JumpList.LoadCurrentAsync();

    // Set the system to autogenerate a Frequent group for the app jump list.
    // Alternatively, this property could be set to JumpListSystemGroupKind.Recent to autogenerate a Recent group.
    jumpList.SystemGroupKind = Windows.UI.StartScreen.JumpListSystemGroupKind.Frequent;

    // No changes were made to the jump list Items property, so any custom tasks and groups remain intact.
    await jumpList.SaveAsync();
}

備註

應用程式 JumpList 是使用 LoadCurrentAsync 方法擷取的。 如果應用程式未自訂其跳躍清單,系統會提供預設的跳躍清單。 目前,預設跳躍清單會顯示最近的專案。 請確定您的應用程式已註冊成為您想要顯示在最近專案清單中之特定檔案類型的預設檔案處理常式。 如需詳細資訊,請參閱 處理檔案啟用

屬性

Items

取得 JumpListItem 的 JumpListItem清單。 專案的類型為 IVector (JumpListItem)

SystemGroupKind

取得或設定系統管理跳躍清單群組的目前類型。

方法

IsSupported()

取得值,這個值表示系統是否支援跳躍清單。

注意

只有桌面裝置系列支援跳躍清單,對具有不同裝置系列之跳躍清單所做的變更將不會保存。

LoadCurrentAsync()

以非同步方式擷取目前的跳躍清單及其專案。

SaveAsync()

以非同步方式儲存跳躍清單及其專案的變更。

適用於

另請參閱