Search code examples
c#windows-runtimewindows-store-appswin-universal-app

How to open the "Open With" dialog (Windows Store App)?


I want my app to let a user open a file with the "Open With" dialog even if it has a default application that opens that type of file. How can I achieve that?


Solution

  • Call Launcher.LaunchFileAsync and set LauncherOptions.DisplayApplicationPicker to true:

    var options = new Windows.System.LauncherOptions();
    options.DisplayApplicationPicker = true;
    
    bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);