C# 클래스 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.

파일 보기 프로젝트 열기: inthehand/Charming 1 사용 예제들

공개 메소드들

메소드 설명
GetForCurrentView ( ) : DataTransferManager

Returns the DataTransferManager object associated with the current window.

ShowShareUI ( ) : void

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

비공개 메소드들

메소드 설명
DataTransferManager ( ) : global::System
OnDataRequested ( DataRequestedEventArgs e ) : void
OnTargetApplicationChosen ( string applicationName ) : void

메소드 상세

GetForCurrentView() 공개 정적인 메소드

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

ShowShareUI() 공개 정적인 메소드

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