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 事件。

适用于