C# Class InTheHand.ApplicationModel.DataTransfer.DataTransferManager

Programmatically initiates an exchange of content with other apps.
The DataTransferManager class is a static class that you use to initiate sharing operations. To use the class, first call the GetForCurrentView method. This method returns the DataTransferManager object that is specific to the active window. Next, you need to add an event listener for the datarequested event to the object. This event is fired when your app starts a share operation programmatically.

The DataTransferManager class includes a ShowShareUI method, which you can use to programmatically start a share operation. In general, we recommend against using this method. Users expect to initiate share operations by using the Share charm—when you launch the operation programmatically, you can create an inconsistent user experience. We include the method because there are a few scenarios in which the user might not recognize opportunities to share. A good example is when the user achieves a high score in a game.

The DataTransferManager class also has a TargetApplicationChosen event. Use this event when you want to capture what applications a user selects when sharing content from your app.

ファイルを表示 Open project: inthehand/Charming Class Usage Examples

Public Methods

Method Description
GetForCurrentView ( ) : DataTransferManager

Returns the DataTransferManager object associated with the current window.

ShowShareUI ( ) : void

Programmatically initiates the user interface for sharing content with another app.

Private Methods

Method Description
DataTransferManager ( ) : global::System
OnDataRequested ( DataRequestedEventArgs e ) : void
OnTargetApplicationChosen ( string applicationName ) : void

Method Details

GetForCurrentView() public static method

Returns the DataTransferManager object associated with the current window.
public static GetForCurrentView ( ) : DataTransferManager
return DataTransferManager

ShowShareUI() public static method

Programmatically initiates the user interface for sharing content with another app.
public static ShowShareUI ( ) : void
return void