Reputation: 45
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
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