Used to interact with the file picker when your app provides a save location with the File Save Picker contract.
Syntax
var fileSavePickerUI = fileSavePickerActivatedEventArgs.fileSavePickerUI;
Attributes
- VersionAttribute(NTDDI_WIN8)
Members
The FileSavePickerUI class has these types of members:
Events
The FileSavePickerUI class has these events.
| Event | Description |
|---|---|
| FileNameChanged | Fired when the user changes the file name in the file name text box or changes the extension in the file type drop-down menu. |
| TargetFileRequested | Fires when the user commits a file to be saved in the file picker. |
Methods
The FileSavePickerUI class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| TrySetFileName | Tries to set the file name and extension in the file picker UI. |
Properties
The FileSavePickerUI class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets a list of file types (extensions) that can be saved to the app that is providing the save location. | |
| Read-only | Gets the full file name of the file to save, including the file type extension. The file name and extension are specified by the user. | |
| Read-only | Gets an identifier for the current context of the file picker. | |
| Read/write | Gets or sets a title to display in the file picker UI that identifies the location that the file picker is displaying to the user. |
Remarks
If your app participates in the File Save Picker contract, you can access this object using a fileSavePickerUI property while you handle a filesavepicker activated event.
Use one of the following properties to retrieve a fileSavePickerUI object:
To learn about creating a good experience for users when they use your app as a save location, see Guidelines and checklist for file picker contracts.
Examples
The File picker sample demonstrates how to respond to a filesavepicker activated event.
// fileSavePicker activated event handler function activated(eventObject) { // Identify whether app is launched for fileSavePicker if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.fileOpenPicker) { // Perform tasks to prepare your app to display its file picker page // Get file picker UI fileOpenPickerUI = eventObject.detail.fileOpenPickerUI; eventObject.setPromise(WinJS.UI.processAll().then(function () { // Navigate to either the first scenario or to the last running scenario // before suspension or termination. var url = scenarios[0].url; return WinJS.Navigation.navigate(url, fileOpenPickerUI); })); } } // Register the activated event handler WinJS.Application.addEventListener("activated", activated, false);
For JavaScript, eventObject contains a webUIFileSavePickerActivatedEventArgs object.
For C#, args contains a FileSavePickerActivatedEventArgs object. Additionally, the OnFileSavePickerActivated is in the App.xaml.cs file and the Activate method is in the FileSavePickerPage.xaml.cs file of the File picker 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
- Guidelines and checklist for file pickers
- JavaScript reference
- Windows.ApplicationModel.Activation.activationKind
- Windows.UI.WebUI.webUIFileOpenPickerActivatedEventArgs.fileSavePickerUI
- C#/C++/VB reference
- Windows.ApplicationModel.Activation.ActivationKind
- Windows.ApplicationModel.Activation.FileOpenPickerActivatedEventArgs.FileSavePickerUI
Build date: 12/4/2012