Udostępnij za pośrednictwem


FileSavePickerUI.TrySetFileName(String) Method

Definition

Tries to set the file name and extension in the file picker UI.

public:
 virtual SetFileNameResult TrySetFileName(Platform::String ^ value) = TrySetFileName;
SetFileNameResult TrySetFileName(winrt::hstring const& value);
public SetFileNameResult TrySetFileName(string value);
function trySetFileName(value)
Public Function TrySetFileName (value As String) As SetFileNameResult

Parameters

value
String

Platform::String

winrt::hstring

The file name and extension that are used to update the file name text box and file type drop-down menu in the file picker UI.

Returns

The enumeration value that indicates whether the file name and extension were updated in the file picker UI.

Remarks

As the provider of a save location, your app should call this method when the user selects a file that is displayed on your app page (which is hosted in the file picker).

This method fails if:

  • The extension specified for the file in value isn't one of the AllowedFileTypes.
  • The file picker UI isn't visible to the user.
  • The user is interacting with the file name text box in the file picker UI.

Applies to