Reputation: 253
I've created an app for windows phone 8 in c#. When a button is pressed i take a screenshot and share it with the social networks, i want to share along the image a prepopulated text in the status textbox, but when i try with the code below it only shares the image, am i doing something wrong?
private void Share_Click(object sender, RoutedEventArgs e)
{
var bmp = new WriteableBitmap(this.theGraph1, null);
var width = (int)bmp.PixelWidth;
var height = (int)bmp.PixelHeight;
using (var ms = new MemoryStream(width * height * 4))
{
bmp.SaveJpeg(ms, width, height, 0, 100);
ms.Seek(0, SeekOrigin.Begin);
var lib = new MediaLibrary();
var picture = lib.SavePicture(string.Format("test.jpg"), ms);
var text = new ShareStatusTask();
var task = new ShareMediaTask();
text.Status = AppResources.ShareThought;
task.FilePath = picture.GetPath();
task.Show();
text.Show();
}
}
Upvotes: 0
Views: 535
Reputation: 16361
You cannot combine ShareStatusTask and ShareMediaTask into a single share "action". The is no way to share text + image using a standard way in WP8, but you can do it in WP8.1, tak a look at http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh871374.aspx
Upvotes: 1