Share via


TargetFileRequest.TargetFile Property

Definition

Gets or sets the IStorageFile object that is provided to represent the file to save by the app that is providing the save location.

public:
 property IStorageFile ^ TargetFile { IStorageFile ^ get(); void set(IStorageFile ^ value); };
IStorageFile TargetFile();

void TargetFile(IStorageFile value);
public IStorageFile TargetFile { get; set; }
var iStorageFile = targetFileRequest.targetFile;
targetFileRequest.targetFile = iStorageFile;
Public Property TargetFile As IStorageFile

Property Value

The object that represents the file to save. The app that called the file picker in order to save will write content to this file.

Remarks

If your app (as the provider of the save location) can't provide an object for the file to save, set this property to null. Unless the user selects an existing file to save, your app should create a StorageFile object to represent the file sets this property to that object.

The file name and extension of the object that represents the file to save must match the file name and extension specified by the user (and accessible through the FileName property) or the attempt to save the file will fail. If the attempt fails, the user can try to save the file again.

Applies to

See also