Språk

JumpList.SetJumpList(Application, JumpList) Metod

Definition

Anger objektet som JumpList är associerat med ett program.

public:
 static void SetJumpList(System::Windows::Application ^ application, System::Windows::Shell::JumpList ^ value);
public static void SetJumpList(System.Windows.Application application, System.Windows.Shell.JumpList value);
static member SetJumpList : System.Windows.Application * System.Windows.Shell.JumpList -> unit
Public Shared Sub SetJumpList (application As Application, value As JumpList)

Parametrar

application
Application

Programmet som är associerat med JumpList.

value
JumpList

Att JumpList associera med programmet.

Exempel

I följande exempel visas hur du skapar en JumpList i kod. Den statiska SetJumpList metoden anropas för att associera JumpList med det aktuella programmet. JumpList tillämpas automatiskt på Windows-gränssnittet när det anges. Det här exemplet är en del av ett större exempel som är tillgängligt i klassöversikten JumpList .

private void SetNewJumpList(object sender, RoutedEventArgs e)
{
    //Configure a new JumpTask
    JumpTask jumpTask1 = new JumpTask();
    // Get the path to WordPad and set the JumpTask properties.
    jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "write.exe");
    jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "write.exe");
    jumpTask1.Title = "WordPad";
    jumpTask1.Description = "Open WordPad.";
    jumpTask1.CustomCategory = "Jump List 2";
    // Create and set the new JumpList.
    JumpList jumpList2 = new JumpList();
    jumpList2.JumpItems.Add(jumpTask1);
    JumpList.SetJumpList(App.Current, jumpList2);
}

Kommentarer

Du kan skapa flera JumpList objekt. Men endast en JumpList i taget kan associeras med en Application. SetJumpList Anropa metoden för att ange för JumpList närvarande associerad med en Application.

Gäller för