You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewInvalidOperationException("You cannot use the AddArgument methods when using dismiss or snooze activation.");
230
+
}
231
+
216
232
boolalreadyExists=_arguments.ContainsKey(key);
217
233
218
234
_arguments[key]=value;
@@ -314,6 +330,48 @@ public ToastButton SetAfterActivationBehavior(ToastAfterActivationBehavior after
314
330
returnthis;
315
331
}
316
332
333
+
/// <summary>
334
+
/// Configures the button to use system snooze activation when the button is clicked, using the default system snooze time.
335
+
/// </summary>
336
+
/// <returns>The current instance of <see cref="ToastButton"/></returns>
337
+
publicToastButtonSetSnoozeActivation()
338
+
{
339
+
returnSetSnoozeActivation(null);
340
+
}
341
+
342
+
/// <summary>
343
+
/// Configures the button to use system snooze activation when the button is clicked, with a snooze time defined by the specified selection box.
344
+
/// </summary>
345
+
/// <param name="selectionBoxId">The ID of an existing <see cref="ToastSelectionBox"/> which allows the user to pick a custom snooze time. The ID's of the <see cref="ToastSelectionBoxItem"/>s inside the selection box must represent the snooze interval in minutes. For example, if the user selects an item that has an ID of "120", then the notification will be snoozed for 2 hours. When the user clicks this button, if you specified a SelectionBoxId, the system will parse the ID of the selected item and snooze by that amount of minutes.</param>
346
+
/// <returns>The current instance of <see cref="ToastButton"/></returns>
thrownewInvalidOperationException($"{nameof(SetSnoozeActivation)} cannot be used in conjunction with ${nameof(AddArgument)}.");
352
+
}
353
+
354
+
_usingSnoozeActivation=true;
355
+
_snoozeSelectionBoxId=selectionBoxId;
356
+
357
+
returnthis;
358
+
}
359
+
360
+
/// <summary>
361
+
/// Configures the button to use system dismiss activation when the button is clicked (the toast will simply dismiss rather than activating).
362
+
/// </summary>
363
+
/// <returns>The current instance of <see cref="ToastButton"/></returns>
364
+
publicToastButtonSetDismissActivation()
365
+
{
366
+
if(_arguments.Count>0)
367
+
{
368
+
thrownewInvalidOperationException($"{nameof(SetDismissActivation)} cannot be used in conjunction with ${nameof(AddArgument)}.");
369
+
}
370
+
371
+
_usingDismissActivation=true;
372
+
returnthis;
373
+
}
374
+
317
375
/// <summary>
318
376
/// Sets an identifier used in telemetry to identify your category of action. This should be something like "Delete", "Reply", or "Archive". In the upcoming toast telemetry dashboard in Dev Center, you will be able to view how frequently your actions are being clicked.
319
377
/// </summary>
@@ -349,7 +407,7 @@ public ToastButton SetTextBoxId(string textBoxId)
0 commit comments