LauncherOptions class
Specifies the options used to launch the default app for a file or URI.
Syntax
var launcherOptions = new Windows.System.LauncherOptions();
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The LauncherOptions class has these types of members:
Constructors
The LauncherOptions class has these constructors.
| Constructor | Description |
|---|---|
| LauncherOptions | Creates and initializes a new instance of the launcher options object. |
Methods
The LauncherOptions class inherits methods from the Object class (C#/VB/C++).
Properties
The LauncherOptions class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write | Gets or sets the content type that is associated with a URI that represents a file on the network. | |
| Read/write | Gets or sets a value that indicates whether to display the Open With dialog whenever the association launching API is called. | |
| Read/write | Gets or sets a value that represents a URI that the user should be taken to in the browser if no app exists to handle the file type or URI. | |
| Read/write | Gets or sets a value that represents the display name of the app in the store that the user should install if no app exists to handle the file type or URI. | |
| Read/write | Gets or sets a value that represents the package family name of the app in the Store that the user should install if no app exists to handle the file type or URI. | |
| Read/write | Gets or sets a value that indicates whether the system should display a warning that the file or URI is potentially unsafe when starting the app associated with a file or URI. | |
| Read-only | Gets the user interface (UI) options when starting a default app. |
Remarks
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 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- 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
