FileSavePickerActivatedEventArgs 類別

定義

提供使用者透過檔案選擇器儲存檔案並選取應用程式作為位置時所引發之啟動事件的相關資訊。

JAVAscript 此類型會顯示為 WebUIFileSavePickerActivatedEventArgs

public ref class FileSavePickerActivatedEventArgs sealed : IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
public ref class FileSavePickerActivatedEventArgs sealed : IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileSavePickerActivatedEventArgs final : IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileSavePickerActivatedEventArgs final : IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileSavePickerActivatedEventArgs : IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileSavePickerActivatedEventArgs : IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
Public NotInheritable Class FileSavePickerActivatedEventArgs
Implements IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
Public NotInheritable Class FileSavePickerActivatedEventArgs
Implements IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
繼承
Object Platform::Object IInspectable FileSavePickerActivatedEventArgs
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

檔案選擇器合約範例示範如何回應FileSavePicker啟用點。

// fileSavePicker activated event handler
protected override void OnFileSavePickerActivated(FileSavePickerActivatedEventArgs args)
{
    var FileSavePickerPage = new SDKTemplate.FileSavePickerPage();
    FileSavePickerPage.Activate(args);
}

// Overloaded method to respond to fileSavePicker events
internal void Activate(FileSavePickerActivatedEventArgs args)
{
    // Perform tasks to prepare your app to display its file picker page

    // Get file picker UI
    fileSavePickerUI = args.FileSavePickerUI;

    Window.Current.Content = this;
    this.OnNavigatedTo(null);
    Window.Current.Activate();
}

針對 C#, args 針對Application物件上的OnFileSavePickerActivated覆寫,會參考 FileSavePickerActivatedEventArgs 物件。 OnFileSavePickerActivated覆寫位於 App.xaml.cs 檔案中,而 Activate 方法位於檔案選擇器合約範例的 FileSavePickerPage.xaml.cs 檔案中。

備註

深入瞭解如何提供您的應用程式作為使用者可在 Windows.Storage.Pickers.Provider 命名空間參考中儲存檔案的位置。

當使用者透過檔案選擇器儲存檔案並選取應用程式作為位置時,FileSavePickerActivatedEventArgs 物件會傳遞至應用程式的啟動點處理常式。 此類型的啟用是由Kind屬性所傳回的ActivationKind.FileSavePicker值表示。

以 JavaScript 撰寫的應用程式必須接聽並處理 Windows.UI.WebUI.webUIApplication.activated 事件。

使用 C++、C# 或 Visual Basic 的 UWP 應用程式通常會藉由覆寫 Application 物件的方法來實作啟用點。 預設範本 app.xaml 程式碼後置檔案一律會包含 OnLaunched的覆寫,但定義其他啟用點的覆寫,例如 OnFileSavePickerActivated ,取決於您的應用程式程式碼。

啟用案例所涉及的所有 應用程式 覆寫都應該在其實作中呼叫 Window.Activate

版本歷程記錄

Windows 版本 SDK 版本 新增值
1607 14393 User

屬性

CallerPackageFamilyName

啟動此應用程式之應用程式的套件系列名稱。

EnterpriseId

取得擁有檔案之企業的識別碼。

FileSavePickerUI

取得當使用者儲存檔案並選取應用程式做為儲存位置時所顯示的檔案選擇器的信件箱 UI。

Kind

取得啟用類型。

PreviousExecutionState

取得應用程式啟動前的執行狀態。

SplashScreen

取得 SplashScreen 物件,提供從啟動顯示畫面轉換到啟動的應用程式的相關資訊。

User

取得應用程式已啟用的使用者。

適用於

另請參閱