locked
After navigating back fromDataTransfer share target dialog app can't continue without debugger

    Question

  • I successfully opening share dialog and I am able to share my text, but if I navigating back, dialog disappears and there is no my app. If debugger is attached, than everything works perfectly and app is not disappears.

    Here is code (C#):

    private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
            {                        
                ShareAsTextLoad();
            }
    
    private void ShareAsTextLoad()
            {
                DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
                dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);            
            }
    
            private void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
            {
                DataRequest request = e.Request;
                request.Data.Properties.Title = (string)DataViewModel[UniqueId];
                //request.Data.Properties.Description = "Sharing list";
                request.Data.SetText(dataShare.ComposeText((string)DataViewModel[UniqueId]));
            }
            
            private void ShareProgrammatically()
            {
                Windows.ApplicationModel.DataTransfer.DataTransferManager.ShowShareUI();
            }        


    Friday, December 12, 2014 12:01 AM

Answers

All replies