// *** Methods ***

            public void Activate(IShareOperation shareOperation)
            {
                ActivateEvents.Add(shareOperation);
            }
Exemple #2
0
        public async void Activate(IShareOperation shareOperation)
        {
            this.shareOperation = shareOperation;

            // Communicate metadata about the shared content through the view model

            var shareProperties = this.shareOperation.Data.Properties;

            this.Title = shareProperties.Title;
            this.Description = shareProperties.Description;
            this.Sharing = false;
            this.Comment = String.Empty;
            this.SupportsComment = true;

            // Update the shared content's thumbnail image in the background

            BitmapImage thumbnailImage = new BitmapImage();
            this.Image = thumbnailImage;
            this.ShowImage = false;

            if (shareProperties.Thumbnail != null)
            {
                var stream = await shareProperties.Thumbnail.OpenReadAsync();
                thumbnailImage.SetSource(stream);
                this.ShowImage = true;
            }
        }