1
Answer

Compose Email window in windows store application

Jitali Desai

Jitali Desai

8y
314
1
Hii Can anyone help me to open compose email window in windows store application of version window 8.1  with attachment
Answers (1)
0
Kishor Bikram Oli

Kishor Bikram Oli

NA 6.9k 307k 8y

 While initializing,

var dtm = Windows.ApplicationModel.DataTransfer.DataTransferManager.GetForCurrentView();

dtm.DataRequested += Dtm_DataRequested;

 
 

private async void Dtm_DataRequested(Windows.ApplicationModel.DataTransfer.DataTransferManager sender, Windows.ApplicationModel.DataTransfer.DataRequestedEventArgs args)

{

DataPackage dataToShare = args.Request.Data;

dataToShare.Properties.Title = "Attachment Sharing Application";
dataToShare.Properties.Description = "Attachment Sharing Application that share images";
var storageFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("Assets\\abc.jpg");
var imageStream = Windows.Storage.Streams.RandomAccessStreamReference.CreateFromFile(storageFile);

dataToShare.SetBitmap(imageStream);

}


private void btn_Share_Click(object sender, RoutedEventArgs e)

{


Windows.ApplicationModel.DataTransfer.DataTransferManager.ShowShareUI();

}

 

 


 
I have attached the complete working source code sample. If any confusion please refer this sample.
 
Thanks!