Skip to content

Instantly share code, notes, and snippets.

@r4hulp
Last active December 29, 2017 12:16
Show Gist options
  • Save r4hulp/4c577c4d9e13d16d7b58a677a00a3b86 to your computer and use it in GitHub Desktop.
Save r4hulp/4c577c4d9e13d16d7b58a677a00a3b86 to your computer and use it in GitHub Desktop.
RootDialog calling other dialog using dialog factory
[Serializable]
public class RootDialog : IDialog<object>
{
private ConversationReference conversationReference;
private IDialogFactory dialogFactory;
public RootDialog(IDialogFactory dialogFactory)
{
this.dialogFactory = dialogFactory;
}
public async Task StartAsync(IDialogContext context)
{
context.Wait(this.MessageReceivedAsync);
}
public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> item)
{
var message = await item;
context.Call(this.dialogFactory.Create<ProfileDialog>(), this.AfterProfileDialog);
}
private async Task AfterDailyStatusDialogAsync(IDialogContext context, IAwaitable<object> result)
{
context.Done("Thanks");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment