Skip to content

Instantly share code, notes, and snippets.

@pnp0a03
Created January 28, 2018 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnp0a03/a7c2e913818372aa36370b098296735f to your computer and use it in GitHub Desktop.
Save pnp0a03/a7c2e913818372aa36370b098296735f to your computer and use it in GitHub Desktop.
GenerateCardJsonString
private string GenerateCardJsonString(FutaThreadView.PostsLoadFinishedEventArgs e)
{
string retVal = "";
string title = e.Title;
string subTitle = GenerateCardSubTitle(e);
AdaptiveCard card = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0));
card.BackgroundImage = new Uri(e.ThumbUrl);
card.Type = "AdaptiveCard";
card.Body.Add(new AdaptiveTextBlock() { Text = title, Size = AdaptiveTextSize.Large, Weight = AdaptiveTextWeight.Bolder, Wrap = true, MaxLines = 3 });
card.Body.Add(new AdaptiveTextBlock() { Text = subTitle, Size = AdaptiveTextSize.Default, Weight = AdaptiveTextWeight.Default, Wrap = true, MaxLines = 3 });
retVal = card.ToJson();
return retVal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment