Adaptive Cards for Windows Developers
We're thrilled you want to try out Adaptive Cards! 🙌
... but we want to take this opportunity to remind you that we're in preview and actively seeking feedback, so please expect a few rough edges and reach out with any feedback you have.
The first Windows experience to supports Adaptive Cards will be Timeline, a brand new experience coming in a future Windows release.
Timeline is not in current Windows builds (even Insider builds), so there's no way to view your Activities at this time. The following API is provided to highlight the proposed direction.
Windows.ApplicationModel.UserActivities.UserActivity API is what populates an Activity into Timeline.
The Adaptive Card will be supplied via the
Content property of
VisualElement, as seen below:
UserActivity userActivity = await channel.GetOrCreateUserActivityAsync(activityId, new HostName("contoso.com")); userActivity.ActivationUri = new Uri("rss-reader:article?" + article.Link); userActivity.DisplayText = article.Title; //used for details tile text userActivity.VisualElements.Content = AdaptiveCardBuilder.CreateAdaptiveCardFromJson(jsonString); await userActivity.SaveAsync();
This session at Build 2017 covers User Activities in detial.
Other Windows Surfaces
We don't have anything to share just yet, but we're working on incorporating Adaptive Cards into more Windows experiences.
We've barely scratched the surface in this tutorial, so check back soon and browse the links below to explore more about Adaptive Cards.