Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataObject.AddSettingDataHandler Method

Adds a SettingData event handler to a specified dependency object.

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

public static void AddSettingDataHandler (
	DependencyObject element,
	DataObjectSettingDataEventHandler handler
)
public static void AddSettingDataHandler (
	DependencyObject element, 
	DataObjectSettingDataEventHandler handler
)
public static function AddSettingDataHandler (
	element : DependencyObject, 
	handler : DataObjectSettingDataEventHandler
)
You cannot use methods in XAML.

Parameters

element

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

A delegate that references the handler method to add.

The SettingData event occurs as part of a copy or drag command, once for each of the data formats to add to the associated data object. Typically, this event is connected to a content control, such as TextBox.

A handler for this event can be used to selectively prevent unwanted data formats from being added to the data object, thus eliminating data conversion processing for redundant data formats and improving the overall performance of a copy operation. To skip a particular data format, call the CancelCommand method and specify the format to skip in the Format property. Calling the CancelCommand method for this event does not cancel the associated copy or drag command.

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft