Gets or sets a value that indicates whether to display the Open With dialog whenever the association launching API is called.
Syntax
var displayApplicationPicker = launcherOptions.displayApplicationPicker;
launcherOptions.displayApplicationPicker = displayApplicationPicker;
Property value
Type: Boolean [JavaScript] | System.Boolean [.NET] | Platform::Boolean [C++]
True if the Open With dialog should always be displayed; otherwise false.
Remarks
You should use the Open With dialog box when the user may want to select an app other than the default for a particular file. For example if your app allows the user to launch an image file, the default handler will likely be a viewer app. In some cases the user may want to edit the image instead of viewing it. Use the Open With option along with an alternative command in the AppBar or in a context menu to let the user bring up the Open With dialog and select the editor app in these types of scenarios.
Windows Phone 8
This API is not implemented and will throw an exception if called.
Examples
Call the Launcher.LaunchFileAsync(IStorageFile, LauncherOptions) | launchFileAsync(IStorageFile, LauncherOptions) method with LauncherOptions.DisplayApplicationPicker | displayApplicationPicker set to true to launch the app that the user selects for the file from the Open With dialog box.
// Path to the file in the app package to launch var imageFile = "images\\test.png"; // Get the image file from the package's image directory Windows.ApplicationModel.Package.current.installedLocation.getFileAsync(imageFile).then( function (file) { // Set the show picker option var options = new Windows.System.LauncherOptions(); options.displayApplicationPicker = true; // Launch the retrieved file using the selected app Windows.System.Launcher.launchFileAsync(file, options).then( function (success) { if (success) { // File launched } else { // File launch failed } }); });
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- LauncherOptions
- Samples
- Association launching sample
- Tasks
- How to launch the default app for a file (JavaScript)
- How to launch the default app for a file (C#/VB/C++)
- How to launch the default app for a URI (JavaScript)
- How to launch the default app for a URI (C#/VB/C++)
- Guidelines
- Guidelines and checklist for file types and URIs
- Reference
- Launcher.LaunchFileAsync(IStorageFile, LauncherOptions)
- Launcher.LaunchUriAsync(Uri, LauncherOptions)
Build date: 2/25/2013