語言

LaunchActivatedEventArgs 類別

定義

當應用程式啟動時提供活動資訊。

JavaScript 此類型以 WebUILaunchActivatedEventArgs 形式出現。

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

Windows 需求

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

備註

這個物件會在你回應 ActivationKind啟動時存取。

使用 C++、C# 或 Visual Basic 的 UWP 應用程式通常透過覆寫應用程式物件的方法來實作啟用點。 預設模板 app.xaml 背後的程式碼檔案總是包含 OnLaunched 的覆寫。 預設實作包含初始導航支援及 SuspensionManager 輔助類別的狀態管理。

所有在啟用情境中涉及的 應用程式 覆寫,都應在其實作中呼叫 Window.Activate 。

如果任務可能大幅增加應用程式啟動時間,請避免在啟動時執行。 相反地,你可以透過聆聽啟動 畫面(SplashScreen.Dismissed )事件來觸發額外的載入任務。

啟動延遲物件不應在啟動期間用於完成複雜任務。 啟用過程中發生的任何未處理錯誤或異常(包括延遲啟用)都會導致應用程式當機。 如果你需要在啟用時執行網路呼叫或處理多個額外檔案,建議先啟動應用程式到延伸的啟動畫面,然後執行這些操作。 欲了解更多資訊,請參閱 如何長時間顯示啟動畫面。

Important

需要過長啟動時間的應用程式可能會被系統終止。

測試應用程式時,請注意,若剛結束的應用程式立即重新啟動,若啟動畫面仍可見,啟動失敗將導致啟動失敗。

JavaScript 啟動完成

若使用 JavaScript 程式設計,啟動即完成,當你啟用的事件處理器在執行啟動任務後成功返回時。

.NET 發射完成

如果使用 C#、VB 或 C++ 程式設計,啟動應用程式視窗時即完成啟動。

版本歷程記錄

Windows版本 SDK 版本 附加價值
1607 14393 TileActivatedInfo
1607 14393 User

屬性

名稱 Description
Arguments

會取得啟動時傳給應用程式的啟動參數。

CurrentlyShownApplicationViewId

取得目前顯示應用程式檢視的識別碼。

Kind

明白為什麼這個應用程式會被啟動。

PrelaunchActivated

顯示該應用程式是否預先上線。

PreviousExecutionState

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

SplashScreen

取得啟動畫面物件,提供從啟動畫面轉換到已啟用應用程式的資訊。

TileActivatedInfo

當使用者從磁貼啟動你的應用程式時,會獲得額外資訊。 如果應用程式未從其磁貼啟動,或是在不支援此特性的平台上啟動,該設定將為 空 。

TileId

它會取得啟動應用程式時被呼叫的磁貼的 ID。

User

它會取得該應用程式啟用的使用者。

ViewSwitcher

取得 View 切換器物件,讓你能設定應用程式的視圖。

適用於

另請參閱