PromptDialog.Choice does not show choices

邮差的信 提交于 2019-12-23 18:42:21

问题


I'm looking for how we can show choices to user with IDialog<object> and PromtDialog.Choice method. But the thing is below code sample doesn't show the choices. Very difficult to find code sample. Looking for a help. Thank you.

 List<string> BotOptions = new List<string>();
                BotOptions.Add("Find a Program");
                BotOptions.Add("Find an Event");
                PromptDialog.Choice(context, 
                    ChoiceSelectAsync,BotOptions,
                    "I didn't understand you. I'm cable to help you with", 
                    "Didn't get that", 
                    1, 
                    PromptStyle.None);

回答1:


You need to change the PromptStyle to anything but None.

The available options are:

Auto
Generate buttons for choices and let connector generate the right style based on channel capabilities

AutoText
Show choices as Text. The prompt decides if it should generate the text inline or perline based on number of choices.

Inline
Show choices on the same line.

PerLine
Show choices with one per line.

None
Do not show possible choices in the prompt

source




回答2:


I think to get the prompt of choices you must "call" the promptDialog, use 'PromptChoice' option instead of 'choice'

var choosenResult = new PromptDialog.PromptChoice<string> (new string[] { "Find a Program", "Find an Event" }, "Which one would you like?", "Didn't get that", 3); context.Call(choosenResult, AfterUserHasChosenAsync);



来源:https://stackoverflow.com/questions/38072037/promptdialog-choice-does-not-show-choices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!