I am trying to implement share functionality in windows phone 8 where if a user long press on an image it shows a context menu with default share options (including installed applications through which we can share on Phone). For that I am using DataTransferManager Class and getting System.NotSupportedException - Specified method is not supported. when I am calling the below event
private void Image_Hold(object sender, GestureEventArgs e)
{
// get the DataTransferManager object associated with current window
**var dataTransferManager = DataTransferManager.GetForCurrentView();**
// register event to handle the share operation when it starts
dataTransferManager.DataRequested -= OnDataRequested;
dataTransferManager.DataRequested += OnDataRequested;
// show the charm bar with Share option opened
DataTransferManager.ShowShareUI();
}
I am referring MSDN for the same which says minimum requirement is Windows Phone 8 and this API will be supportive only in native apps.
Please, let me know any way to resolve this. Thanks in advance.