Last active
May 2, 2020 21:47
-
-
Save DeeJayTC/fa795c8859888d87983a41ab2a335298 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"{<property>}": "Implicitly binds to `$data.<property>`", | |
"$data": "The current data object", | |
"$root": "The root data object.", | |
"$index": "The current index when iterating", | |
"$host": "Access properties of the host *(not working yet)*" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "AdaptiveCard", | |
"body": [{ | |
"type": "TextBlock", | |
"size": "Medium", | |
"weight": "Bolder", | |
"text": "My list of people" | |
}, | |
{ | |
"type": "FactSet", | |
"facts": [{ | |
"title": "Micky Mouse", | |
"value": "44" | |
}, | |
{ | |
"title": "Harry Potter", | |
"value": "18" | |
}, | |
{ | |
"title": "Matt Hidinger", | |
"value": "28" | |
} | |
] | |
} | |
], | |
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | |
"version": "1.0" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create card | |
var card = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0)) | |
{ | |
// Use LINQ to turn the choices into submit actions | |
Actions = choices.Select(choice => new AdaptiveSubmitAction | |
{ | |
Title = choice, | |
Data = choice, // This will be a string | |
}).ToList<AdaptiveAction>(), | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "My list of people:", | |
"count": 4, | |
"people": [{ | |
"firstName": "Micky", | |
"lastName": "Mouse", | |
"age": 44 | |
}, | |
{ | |
"firstName": "Donald", | |
"lastName": "Duck", | |
"age": 12 | |
}, | |
{ | |
"firstName": "Harry", | |
"lastName": "Potter", | |
"age": 18 | |
}, | |
{ | |
"firstName": "Matt", | |
"lastName": "Hidinger", | |
"age": "28" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "AdaptiveCard", | |
"body": [ | |
{ | |
"type": "TextBlock", | |
"size": "Medium", | |
"weight": "Bolder", | |
"text": "{title}" | |
}, | |
{ | |
"type": "FactSet", | |
"facts": [ | |
{ | |
"$data": "{people}", | |
"$when": "{$index.age > 12}", | |
"title": "{$index.firstName} {$index.lastName}", | |
"value": "{$index.age}" | |
} | |
] | |
} | |
], | |
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | |
"version": "1.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment