locked
How to get notified that the share operation has completed

    Question

  • I am building an Windows 8 app. I am using the share charm to let users share data. I want to get notified that the user completed the share operation. I have tried with

            private static void ShareTextHandler(DataTransferManager sender, DataRequestedEventArgs e)
            {
              ..........
                request.Data.OperationCompleted += Data_OperationCompleted;
                request.Data.Destroyed += Data_Destroyed;
              ..........
            }

    But the two event handlers never get triggered. Is there a proper way to find out the user has finished sharing content (The charms bar has collapsed after the share operation finished)
    Thursday, October 30, 2014 3:38 PM

Answers

  • Hi ventura8,

    Have you ever consider such situation: if user cancel the share operation on the share app, will you define it as operation completed?

    Basically Windows Store App cannot get state from other app.

    Anyway, if you read the documentation OperationCompleted | operationcompleted event:

    This event occurs when a user or program pastes content from the Clipboard. If your app is using the DataPackage for share operations, you do not have to handle this event.

    --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.


    Friday, October 31, 2014 2:27 AM
    Moderator