Gets a clipboard DataPackage as passed to the WebView.
Syntax
Property value
Type: DataPackage
A clipboard data package.
Remarks
This property is typically used to support sharing. During a share operation, the source app puts the data being shared in a DataPackage object and sends that object to the target app for processing.
Examples
The following code example demonstrates how to use this property to implement sharing support. The full code listing for this example is available in the XAML WebView control sample.
private void Share_Click(object sender, RoutedEventArgs e) { dataTransferManager = DataTransferManager.GetForCurrentView(); dataTransferManager.DataRequested += dataTransferManager_DataRequested; DataTransferManager.ShowShareUI(); } void dataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args) { DataRequest request = args.Request; DataPackage p = WebView7.DataTransferPackage; if (p.GetView().Contains(StandardDataFormats.Text)) { p.Properties.Title = "WebView Sharing Excerpt"; p.Properties.Description = "This is a snippet from the content hosted in the WebView control"; request.Data = p; } else { request.FailWithDisplayText("Nothing to share"); } dataTransferManager.DataRequested -= dataTransferManager_DataRequested; }
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 3/12/2013