DataPackage.RequestedOperation DataPackage.RequestedOperation DataPackage.RequestedOperation DataPackage.RequestedOperation DataPackage.RequestedOperation Property


Specifies the DataPackageOperation (none, move, copy, or link) for the operation.

public : DataPackageOperation RequestedOperation { get; set; }
DataPackageOperation RequestedOperation();

void RequestedOperation(DataPackageOperation requestedoperation);
public DataPackageOperation RequestedOperation { get; set; }
Public ReadWrite Property RequestedOperation As DataPackageOperation
var dataPackageOperation = dataPackage.requestedOperation;
dataPackage.requestedOperation = dataPackageOperation;

Property Value

The operation requested by the source app.


// Request a copy operation 
datapackage.RequestedOperation = DataPackageOperation.Copy;

// find what the requested operation is
DataPackageOperation operation = dataPackageView.RequestedOperation;
// find out what the requested operation is
var operation = dataPackage.requestedOperation;

// Request a copy operation from targets that support different file operations, like Windows Explorer
dataPackage.requestedOperation = Windows.ApplicationModel.DataTransfer.DataPackageOperation.copy;


This property specifies the operation the consumer of a data package should perform in clipboard or drag and drop scenarios. The supported options are specified in the DataPackageOperation enumeration.

When implementing clipboard functionality, DataPackageOperation.Move corresponds to the "Cut" command and DataPackageOperation.Copy to "Copy" command. It is the target of the operation's responsibility to respect this value and report that they performed a cut or copy by calling DataPackageView.ReportOperationComplete with the appropriate value.

In drag and drop scenarios, CoreDragOperation.AllowedOperations should specify the complete set of operations the source allows, and DataPackage.RequestedOperation should specify the source's desired default. Users can override this choices by using SHIFT and CTRL keys. Target apps must inspect the key state to determine the operation the user has selected.


CoreDragOperation.AllowedOperations is not supported in XAML. To specify more than one allowed operation in XAML, pass multiple flags to the DataPackage.RequestedOperation property instead. If you do, you should not set CoreDragOperation.AllowedOperations elsewhere. Doing so will throw an exception and reset the specified flags of DataPackage.RequestedOperation to one.

Normally, DataPackage.RequestedOperation property should specify only a single operation. However, in some interop scenarios (such as copying between a Universal Windows Platform (UWP) app and File Explorer), it can contain more. In this case, the target app should select the best operation (assuming keyboard modifiers have not overridden that choice).

You do not need this property for sharing operations.

See also