user3773678
user3773678

Reputation: 45

How to prevent Open With dialog from appearing all the time in windows store app?

When I open a file for the first time, an "open with" dialog appears. I select the desired app with which to open the file and tick the option to always use that app.

When I open the same file a second time, the "open with" dialog appears once more, despite my having ticked the "always use this app" option. How can I go about preventing this?

Here's what I've tried so far:

var options = new LauncherOptions();

options.DisplayApplicationPicker = true;
await Launcher.LaunchFileAsync(fileToBeOpened.McmDocument, options);

Upvotes: 2

Views: 216

Answers (1)

Rob Caplan - MSFT
Rob Caplan - MSFT

Reputation: 21919

From what you describe you don't want to set DisplayApplicationPicker = true.

If the user doesn't have a default set then LaunchFileAsync will open the Open With dialog automatically. There is no need to set DisplayApplicationPicker = true;

DisplayApplicationPicker = true explicitely says to ignore the default setting.

The "always use this app" option sets the default to that app so that normal launches (without DisplayApplicationPicker = true) will open the selected app.

Upvotes: 1

Related Questions