在自适应卡1.0中添加编辑按钮

时间:2019-10-22 06:46:02

标签: adaptive-cards

我需要添加一个编辑选项来修改文本块中的文本。我正在使用1.0版。 怎么做?

  public async Task BookMeeting(ITurnContext<IMessageActivity> turnContext, Activity activity, JToken row)
        {

            //adaptive card
            Activity replyToConversation = activity.CreateReply();

            replyToConversation.Attachments = new List<Attachment>();

            AdaptiveCards.AdaptiveCard card = new AdaptiveCards.AdaptiveCard();

            var header = row["card"]["data"]["label1"];
            var subHeading = row["card"]["data"]["label2"];
            var subHeading1 = row["card"]["data"]["label4"];
            // Add text to the card.
            card.Body.Add(new AdaptiveTextBlock()
            {
                Text = header.ToString(),
                Size = AdaptiveTextSize.Medium,
                Color = AdaptiveTextColor.Accent,
                Weight = AdaptiveTextWeight.Bolder
            });
                      card.Actions = new List<AdaptiveAction>()
                {
                 new AdaptiveSubmitAction
                    {
                        Title = "Cancel",
                        DataJson = "{ \"Type\": \"Cancelled\" }",

                    },
                    new AdaptiveSubmitAction
                    {
                        Title = "Confirm",
                        DataJson = "{ \"Type\": \"book-user-meeting\" }",

                    }
                 };
            // Create the attachment.
            Attachment attachment = new Attachment()
            {
                ContentType = AdaptiveCards.AdaptiveCard.ContentType,
                Content = card
            };

            replyToConversation.Attachments.Add(attachment);
            await turnContext.SendActivityAsync(replyToConversation, CancellationToken.None);

        }

0 个答案:

没有答案