Bagikan melalui


UserActivityRequest.SetUserActivity(UserActivity) Metode

Definisi

Mengatur UserActivity untuk ditampilkan saat peristiwa UserActivityRequested dinaikkan .

public:
 virtual void SetUserActivity(UserActivity ^ activity) = SetUserActivity;
void SetUserActivity(UserActivity const& activity);
public void SetUserActivity(UserActivity activity);
function setUserActivity(activity)
Public Sub SetUserActivity (activity As UserActivity)

Parameter

activity
UserActivity

Aktivitas pengguna untuk disimpan.

Contoh

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);
}

Keterangan

UserActivity.ActivationUri dan UserActivity.VisualElements.DisplayText harus diatur atau metode ini akan gagal.

Berlaku untuk