how to pass value from one WaterfallDialog to another WaterfallDialog in ComponentDialog

*爱你&永不变心* 提交于 2019-12-11 18:12:55

问题


bot framework v4

I have two WaterfallDialogs in ComponentDialog.

I could store value like below in WaterfallDialogs

step.values[currenctCategory] = result;

but when i prompt another second WaterfallDialog from the first WaterfallDialog , i could not get the step.values[currenctCategory] in second WaterfallDialog


回答1:


You need to use the State to store the intermediate values that you will need in any of the parent or child dialogs. In version 4 you can do that using the BotAccessors something on below lines

 public static string CounterStateName { get; } = $"{nameof(BotAccessors)}.CounterState";

    /// <summary>
    /// Gets or sets the <see cref="IStatePropertyAccessor{T}"/> for CounterState.
    /// </summary>
    /// <value>
    /// The accessor stores the turn count for the conversation.
    /// </value>
    public IStatePropertyAccessor<CounterState> CounterState { get; set; }


来源:https://stackoverflow.com/questions/52885068/how-to-pass-value-from-one-waterfalldialog-to-another-waterfalldialog-in-compone

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