Edit

Share via


ToastButton Class

Definition

A button that the user can click on a Toast notification.

public sealed class ToastButton : Microsoft.Toolkit.Uwp.Notifications.IToastButton
type ToastButton = class
    interface IToastButton
Public NotInheritable Class ToastButton
Implements IToastButton
Inheritance
ToastButton
Implements

Constructors

ToastButton()

Initializes a new instance of the ToastButton class.

ToastButton(String, String)

Initializes a new instance of the ToastButton class.

Properties

ActivationOptions

Gets or sets additional options relating to activation of the toast button. New in Creators Update

ActivationType

Gets or sets what type of activation this button will use when clicked. Defaults to Foreground.

Arguments

Gets app-defined string of arguments that the app can later retrieve once it is activated when the user clicks the button. Required

Content

Gets the text to display on the button. Required

HintActionId

Gets or 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.

ImageUri

Gets or sets an optional image icon for the button to display (required for buttons adjacent to inputs like quick reply).

TextBoxId

Gets or sets the ID of an existing ToastTextBox in order to have this button display to the right of the input, achieving a quick reply scenario.

Methods

AddArgument(String)

Adds a key (without value) to the activation arguments that will be returned when the toast notification or its buttons are clicked.

AddArgument(String, Boolean)

Adds a key/value to the activation arguments that will be returned when the toast notification or its buttons are clicked.

AddArgument(String, Double)

Adds a key/value to the activation arguments that will be returned when the toast notification or its buttons are clicked.

AddArgument(String, Enum)

Adds a key/value to the activation arguments that will be returned when the toast notification or its buttons are clicked.

AddArgument(String, Int32)

Adds a key/value to the activation arguments that will be returned when the toast notification or its buttons are clicked.

AddArgument(String, Single)

Adds a key/value to the activation arguments that will be returned when the toast notification or its buttons are clicked.

AddArgument(String, String)

Adds a key/value to the activation arguments that will be returned when the toast notification or its buttons are clicked.

SetAfterActivationBehavior(ToastAfterActivationBehavior)

Sets the behavior that the toast should use when the user invokes this button. Desktop-only, supported in builds 16251 or higher. New in Fall Creators Update.

SetBackgroundActivation()

Configures the button to use background activation when the button is clicked.

SetContent(String)

Sets the text to display on the button.

SetDismissActivation()

Configures the button to use system dismiss activation when the button is clicked (the toast will simply dismiss rather than activating).

SetHintActionId(String)

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.

SetImageUri(Uri)

Sets an optional image icon for the button to display (required for buttons adjacent to inputs like quick reply).

SetProtocolActivation(Uri)

Configures the button to launch the specified url when the button is clicked.

SetProtocolActivation(Uri, String)

Configures the button to launch the specified url when the button is clicked.

SetSnoozeActivation()

Configures the button to use system snooze activation when the button is clicked, using the default system snooze time.

SetSnoozeActivation(String)

Configures the button to use system snooze activation when the button is clicked, with a snooze time defined by the specified selection box.

SetTextBoxId(String)

Sets the ID of an existing ToastTextBox in order to have this button display to the right of the input, achieving a quick reply scenario.

Applies to