locked
Sharing Files using Share Charm...Windows 8 App

    Question

  • HI Folks,

    I am trying share some details of the product such as image and technical details document via email in a store app, with the code as given below. I am able to add only one category of documents ie(only pdf documents or only images). Cannot add both pdf and image types. Any help would be highly appreciated.

                var storageItems = new List<IStorageItem>();

                var productCatalogfolder = await Windows.Storage.ApplicationData.Current.LocalFolder.GetFolderAsync("ProductCatalogPages");
                var imagesFolder = await Windows.Storage.ApplicationData.Current.LocalFolder.GetFolderAsync("ProductModelClassPictures");
                foreach (var pdf in ViewModel.CatalogPages)
                {
                    try
                    {
                        StorageFile pdfFile = await productCatalogfolder.GetFileAsync(pdf.PdfFileName);
                        if (pdfFile != null)
                        {
                            storageItems.Add(pdfFile);
                        }
                    }
                        // ReSharper disable once EmptyGeneralCatchClause
                    catch (Exception)
                    {

                    }

                }
                //string[] imageNames = ViewModel.ModelImage.Split('/');
                //StorageFile image = await imagesFolder.GetFileAsync(imageNames[imageNames.Count()-1]);
                //storageItems.Add(image);

          requestData.SetStorageItems(storageItems);

    Wednesday, May 28, 2014 1:24 PM

Answers

  • Hi Suresh,

    I'm not sure if you have tried the sample provided by MSDN: http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Source-App-d9bffd84

    You can definitely share multiple files as you can see scenario 5 from the sample.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, May 29, 2014 6:26 AM
    Moderator

All replies

  • Hi,

    I'm afraid that it is not the correct forum about this issue, since this forum is to discuss WPF.

    So I have moved this thread to Windows Store Apps forum for better response.

    Thanks for your understanding.

    Best regards,
    Franklin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 29, 2014 2:57 AM
    Moderator
  • Hi Suresh,

    I'm not sure if you have tried the sample provided by MSDN: http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Source-App-d9bffd84

    You can definitely share multiple files as you can see scenario 5 from the sample.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, May 29, 2014 6:26 AM
    Moderator