Provides information about an activated event that fires when the user tries to pick files or folders that are provided by the app.
JavaScript: This type appears as WebUIFileOpenPickerActivatedEventArgs.
Syntax
public sealed class FileOpenPickerActivatedEventArgs : Object, IFileOpenPickerActivatedEventArgs, IActivatedEventArgs
Attributes
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The FileOpenPickerActivatedEventArgs class has these types of members:
Methods
The FileOpenPickerActivatedEventArgs class inherits methods from the Object class.
Properties
The FileOpenPickerActivatedEventArgs class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the letterbox UI of the file picker that is displayed when the user wants to pick files or folders that are provided by the app. | |
| Read-only | Gets the activation type. | |
| Read-only | Gets the execution state of the app before it was activated. | |
| Read-only | Gets a SplashScreen object that provides information about the transition from the splash screen to the activated app. |
Remarks
Learn how to provide files for the user to pick from your app in Quickstart: Providing file services through file pickers and in the Windows.Storage.Pickers.Provider namespace reference.
A FileOpenPickerActivatedEventArgs object is passed to the app's activated event handler when the user wants to pick files or folders that are provided by the app. This type of activation is indicated by the ActivationKind.FileOpenPicker value that is returned by the Kind property.
Apps written in JavaScript must listen for and handle Windows.UI.WebUI.webUIApplication.activated events.
Windows Store apps built for Windows using C++, C#, or Visual Basic typically implement activation points by overriding methods of the Application object. The default template app.xaml code-behind files always include an override for OnLaunched, but defining overrides for other activation points such as OnFileOpenPickerActivated is up to your app code.
All Application overrides involved in an activation scenario should call Window.Activate in their implementations.
Examples
The File picker contracts sample demonstrates how to respond to a FileOpenPicker activation point.
// File open picker activated event handler protected override void OnFileOpenPickerActivated(FileOpenPickerActivatedEventArgs args) { var FileOpenPickerPage = new SDKTemplate.FileOpenPickerPage(); FileOpenPickerPage.Activate(args); } // Overloaded method to respond to fileOpenPicker events public void Activate(FileOpenPickerActivatedEventArgs args) { // Perform tasks to prepare your app to display its file picker page // Get file picker UI fileOpenPickerUI = args.FileOpenPickerUI; Window.Current.Content = this; this.OnNavigatedTo(null); Window.Current.Activate(); }
For C#, args for an OnFileOpenPickerActivated override references a FileOpenPickerActivatedEventArgs object. The OnFileOpenPickerActivated override is in the App.xaml.cs file and the Activate method is in the FileOpenPickerPage.xaml.cs file of the File picker contracts sample.
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
See also
- Quickstart: Providing file services through file pickers
- File picker contracts sample
- OnFileOpenPickerActivated
- Application
- FileOpenPicker
- Windows.Storage.Pickers.Provider namespace
- Windows.UI.WebUI.WebUIApplication.Activated event
- Windows.UI.Core.CoreApplicationView.Activated event
Build date: 2/25/2013