DataObjectPastingEventArgs Constructor (IDataObject, Boolean, String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes a new instance of DataObjectPastingEventArgs.

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

public DataObjectPastingEventArgs(
	IDataObject dataObject,
	bool isDragDrop,
	string formatToApply


Type: System.Windows.IDataObject

A DataObject containing the data to be pasted.

Type: System.Boolean

A Boolean value indicating whether the paste is part of a drag-and-drop operation. true to indicate that the paste is part of a drag-and-drop operation; otherwise, false. If this parameter is set to true, a Pasting event is fired on drop.

Type: System.String

A string specifying the preferred data format to use for the paste operation. See the DataFormats class for a set of predefined data formats.

Exception Condition

Raised when dataObject or formatToApply is null.


Raised when formatToApply specifies a data format that is not present in the data object specified by dataObject.

A DataObjectPastingEventArgs object is typically created by the application that is initiating the paste operation.

.NET Framework
Available since 3.0
Return to top