共用方式為


UserActivityRequestedEventArgs 類別

定義

傳遞至 UserActivityRequestManager.UserActivityRequested 事件。 允許事件的處理常式傳回 UserActivity

public ref class UserActivityRequestedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class UserActivityRequestedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class UserActivityRequestedEventArgs
Public NotInheritable Class UserActivityRequestedEventArgs
繼承
Object Platform::Object IInspectable UserActivityRequestedEventArgs
屬性

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v6.0 引進)

範例

private async void UserActivityRequested(
    Windows.ApplicationModel.UserActivities.UserActivityRequestManager sender,
    Windows.ApplicationModel.UserActivities.UserActivityRequestedEventArgs args)
{
    UserActivity userActivity = // app code to create a userActivity
    args.Request.SetUserActivity(userActivity);
}

屬性

Request

取得與UserActivityRequestManager.UserActivityRequested 事件處理常式呼叫相關聯的 UserActivityRequest

方法

GetDeferral()

取得延遲物件,讓您可以有更多時間處理 UserActivityRequestManager.UserActivityRequested 事件。

適用於