ActionBase未显示在Adaptive Card中

时间:2018-04-09 05:31:23

标签: botframework adaptive-cards

我的nuget包及其自适应卡的版本。

程序包名称:Microsoft.AdaptiveCards 版本 = 0.5.1.0

当我安装此软件包时,我可以看到 List<ActionBase> 以添加所有自适应卡操作。

版本 = 0.5.1.0的代码示例:

                    List<ActionBase> actionList = new List<ActionBase>();
                    ShowCardAction action1 = new ShowCardAction();
                    action1.Title = "View Comment";
                    actionList.Add(action1);
                    ShowCardAction action2 = new ShowCardAction();
                    action2.Title = "Post Comment";
                    actionList.Add(action2);
                    OpenUrlAction action3 = new OpenUrlAction();
                    action3.Title = "View  Ticket";
                    action3.Url = "<URL>;
                    actionList.Add(action3);

包名称:AdaptiveCards 版本 = 1.0.0

当我安装此软件包时,由于最新版本,我无法看到 List<ActionBase> 如何添加多个卡片操作?

1 个答案:

答案 0 :(得分:1)

在AdaptiveCards Version = 1.0.0中,ActionBase已更改为AdaptiveAction。

这应该有效:

List<AdaptiveAction> actionList = new List<AdaptiveAction>();
AdaptiveShowCardAction action1 = new AdaptiveShowCardAction();
action1.Title = "View Comment";
actionList.Add(action1);
AdaptiveShowCardAction action2 = new AdaptiveShowCardAction();
action2.Title = "Post Comment";
actionList.Add(action2);
AdaptiveOpenUrlAction action3 = new AdaptiveOpenUrlAction();
action3.Title = "View  Ticket";
action3.Url = new Uri("<URL>");
actionList.Add(action3);