microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.72k stars 307 forks source link

JumpList doesn't update when opening a registered file using FileOpenPicker #4503

Open fabianoriccardi opened 1 week ago

fabianoriccardi commented 1 week ago

Describe the bug

My app doesn't update the JumpList content (both in Start Menu and TaskBar) when opening a file using the FileOpenPicker. However, the Jump List is properly updated if I open the file (and my associated app) using a double click on the file icon.

Steps to reproduce the bug

private async void myButton_Click(object sender, RoutedEventArgs e)
{
    FileOpenPicker filePicker = new();
    var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
    WinRT.Interop.InitializeWithWindow.Initialize(filePicker, hwnd);

    filePicker.FileTypeFilter.Add(".lmest");
    var file = await filePicker.PickSingleFileAsync();
}

.lmest is my target extension

Expected behavior

Expected JumpList:

jumplist

populated with the file you have opened through FileOpenPicker

Screenshots

No response

NuGet package version

Windows App SDK 1.5.4: 1.5.240607001

Packaging type

Packaged (MSIX)

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

I have read the following resources to try to solve my question: