Last active
January 28, 2018 02:30
-
-
Save pnp0a03/e343ab64cc533dbea6df615467b11587 to your computer and use it in GitHub Desktop.
GenerateActivityAsync
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
private async Task<bool> GenerateActivityAsync(FutaThreadView.PostsLoadFinishedEventArgs e) | |
{ | |
UserActivityChannel channel = UserActivityChannel.GetDefault(); | |
UserActivity userActivity = await channel.GetOrCreateUserActivityAsync(e.Url); | |
userActivity.ActivationUri = new Uri(e.Url.Replace("http://", "ddlgf10://") + "?View=Post"); | |
userActivity.VisualElements.DisplayText = e.Title + " " + GenerateCardSubTitle(e); | |
var cardstring = GenerateCardJsonString(e); | |
// To use the adaptive card, enable this line. | |
// userActivity.VisualElements.Content = Windows.UI.Shell.AdaptiveCardBuilder.CreateAdaptiveCardFromJson(cardstring); | |
await userActivity.SaveAsync(); | |
activitySession?.Dispose(); | |
activitySession = userActivity.CreateSession(); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment