How do I create a DataObject?

A DataObject can be created in three different overloads of the DataObject constructor. DataObject (object) – In this case, appropriate DataFormat is assigned to the DataObject based on the type of data stored in the object. By default, auto-conversion option is set to ’true’. [C#] string mystring = ‘Drag and Drop String Object’; DataObject dataobject = new DataObject(mystring); DataObject (DataFormat, object) – In this case, DataFormat is mentioned when the DataObject is created. [C#] string mystring = ‘Drag and Drop String Object’; DataObject dataobject = new DataObject(DataFormats.UnicodeText,mystring); DataObject (DataFormat, Object, auto-conversion) – In this case, DataFormat, Object and Auto-Conversion Boolean value are mentioned when the DataObject is created. [C#] string mystring = ‘Drag and Drop String Object’; DataObject dataobject = new DataObject(DataFormats.UnicodeText,mystring,false);

What are the objects involved in DragandDrop?

The following are the some of the objects involved in the DragandDrop process. Drag Source – Object from which an object is dragged from. Drag Object – An object which is dragged. Drag Target – Object into which the dragged object is dropped.

How to pass a parameter to a constructor using ObjectDataProvider ?

ObjectDataProvider provides the ability to pass the parameters to the constructors using the ‘ConstructorParameters’ property. The following code snippet demonstrates how to pass parameters to a constructor. [XAML] <ObjectDataProvider ObjectType='{x:Type local:odpsource}’ x:Key=’obj1?> <ObjectDataProvider.ConstructorParameters> <system:Double>2000</system:Double> </ObjectDataProvider.ConstructorParameters> </ObjectDataProvider>

In what way is an ObjectDataProvider useful?

ObjectDataProvider is a class that wraps your source object to provide some extra functionality. The following are the distinguishing capabilities of ObjectDataProvider. Passing parameters to the constructor. Binding to a method (with or without parameters). Replacing the source object. Creating the source object asynchronously.

When an XMLDataProvider can be used ? What are it’s specific uses ?

An XMLDataProvider can be used when your datasource is an XML file. The following are some of the uses of XMLDataProvider. XML can be pre-filtered using the XPath query of the XMLDataProvider. It automatically reads the XML using a background thread without blocking the UI. Data can be shared among the several controls. If your XML uses Namespaces, then it is the convenient place to assign the XMLNamespaceManager.