Adds a Pasting event handler to a specified dependency object.
Assembly: PresentationCore (in PresentationCore.dll)
static member AddPastingHandler : element:DependencyObject * handler:DataObjectPastingEventHandler -> unit
Use this event to inspect a data object before the data is pasted, and possibly to decide on an alternate course of action, such as:
Cancel the Paste - Cancel the entire paste operation by calling the CancelCommand method.
Select an Alternate Format - Change the selected paste format by specifying a new value for the FormatToApply property. The newly selected format must by supported by the data object to be pasted.
If the paste format is changed, ensure that the paste target supports the newly specified format.
Insert a New Format - If you determine that the paste data object does not support the desired format, update the data object to include a version of the data in the desired format. Custom data converters are often used as part of this process.
Changing the content of a paste data object (DataObject) does not change the data stored on the system Clipboard; any such changes will apply only to the data object associated with the associated paste command.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.