This documentation is archived and is not being maintained.

DataObjectPastingEventArgs.DataObjectPastingEventArgs Constructor

Initializes a new instance of DataObjectPastingEventArgs.

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

public DataObjectPastingEventArgs (
	IDataObject dataObject,
	bool isDragDrop,
	string formatToApply
public DataObjectPastingEventArgs (
	IDataObject dataObject, 
	boolean isDragDrop, 
	String formatToApply
public function DataObjectPastingEventArgs (
	dataObject : IDataObject, 
	isDragDrop : boolean, 
	formatToApply : String
You cannot use constructors in XAML.



A DataObject containing the data to be pasted.


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.


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 typeCondition


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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0