Share via


DialogContext.ReplaceDialogAsync(String, Object, CancellationToken) Method

Definition

Starts a new dialog and replaces on the stack the currently active dialog with the new one. This is particularly useful for creating loops or redirecting to another dialog.

public System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogTurnResult> ReplaceDialogAsync (string dialogId, object options = default, System.Threading.CancellationToken cancellationToken = default);
member this.ReplaceDialogAsync : string * obj * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogTurnResult>
Public Function ReplaceDialogAsync (dialogId As String, Optional options As Object = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DialogTurnResult)

Parameters

dialogId
String

ID of the new dialog to start.

options
Object

Optional, information to pass to the dialog being started.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

If the task is successful, the result indicates whether the dialog is still active after the turn has been processed by the dialog.

Applies to

See also