Språk

JumpList.GetJumpList(Application) Metod

Definition

Returnerar objektet som JumpList är associerat med ett program.

public:
 static System::Windows::Shell::JumpList ^ GetJumpList(System::Windows::Application ^ application);
public static System.Windows.Shell.JumpList GetJumpList(System.Windows.Application application);
static member GetJumpList : System.Windows.Application -> System.Windows.Shell.JumpList
Public Shared Function GetJumpList (application As Application) As JumpList

Parametrar

application
Application

Programmet som är associerat med JumpList.

Returer

Objektet JumpList som är associerat med det angivna programmet.

Exempel

I följande exempel visas hur du hämtar associerade JumpList med det aktuella programmet. A JumpTask läggs till i JumpItems samlingen och läggs till i kategorin Senaste . Metoden Apply anropas för att tillämpa den uppdaterade JumpList på Windows-gränssnittet. Det här exemplet är en del av ett större exempel som är tillgängligt i klassöversikten JumpList .

private void AddTask(object sender, RoutedEventArgs e)
{
    // Configure a new JumpTask.
    JumpTask jumpTask1 = new JumpTask();
    // Get the path to Calculator and set the JumpTask properties.
    jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
    jumpTask1.Title = "Calculator";
    jumpTask1.Description = "Open Calculator.";
    jumpTask1.CustomCategory = "User Added Tasks";
    // Get the JumpList from the application and update it.
    JumpList jumpList1 = JumpList.GetJumpList(App.Current);
    jumpList1.JumpItems.Add(jumpTask1);
    JumpList.AddToRecentCategory(jumpTask1);
    jumpList1.Apply();
}

Kommentarer

Du kan anropa GetJumpList metoden för att hämta den JumpList som för närvarande är associerad med en Application. .NET Framework kräver inte att detta är den JumpList som för närvarande tillämpas på Windows-gränssnittet.

Gäller för