The above answers are good but I noticed some of the links provided are no longer working. Here is how I managed to navigate among different dialogs
public MakeChoiceDialog() : base (nameof(MakeChoiceDialog))
{
AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
AddDialog(new LoginDialog());
AddDialog(new SignUpDialog());
AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
{
LoginStepAsync,
LoginSignUpStepAsync,
}));
InitialDialogId = nameof(WaterfallDialog);
}
The method call will be
private async Task<DialogTurnResult> LoginSignUpStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
string userChoice = ((FoundChoice)stepContext.Result).Value;
var msg = string.Empty;
switch (userChoice)
{
case "Login":
return await stepContext.BeginDialogAsync(nameof(LoginDialog), null, cancellationToken);
default:
return await stepContext.BeginDialogAsync(nameof(SignUpDialog), null, cancellationToken);
}
return await stepContext.EndDialogAsync(null, cancellationToken);
}
In the Startup.cs add the following
services.AddSingleton<LoginDialog>();
services.AddSingleton<SignUpDialog>();