示例#1
0
        public static async Task CreateUserActivityAsync(UserActivityData activityData, IAdaptiveCard adaptiveCard)
        {
            var activity = await activityData.ToUserActivity();

            activity.VisualElements.Content = adaptiveCard;
            await SaveAsync(activity);
        }
示例#2
0
        public static async Task CreateUserActivityAsync(UserActivityData activityData)
        {
            var activity = await activityData.ToUserActivity();

            //cleanup any content assigned earlier
            activity.VisualElements.Content = null;
            await SaveAsync(activity);
        }
示例#3
0
        public static async Task AddSampleUserActivity()
        {
            var activityId    = nameof(SchemeActivationSamplePage);
            var activationUri = new Uri($"wtsapp:sample?paramName1=paramValue1&ticks={DateTime.Now.Ticks.ToString()}");
            var displayText   = "Sample Activity";
            var description   = $"Sample UserActivity added from Application '{Package.Current.DisplayName}' at {DateTime.Now.ToShortTimeString()}";
            var imageUrl      = "http://adaptivecards.io/content/cats/2.png";

            var activityData = new UserActivityData(activityId, activationUri, displayText, Colors.DarkRed);
            var adaptiveCard = CreateAdaptiveCardSample(displayText, description, imageUrl);

            await UserActivityService.CreateUserActivityAsync(activityData, adaptiveCard);
        }