Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-retrieve-data-in-a-particular-data-format.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

2.2 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Retrieve Data in a Particular Data Format 03/30/2017
csharp
vb
drag-and-drop [WPF], retrieving data
DataFormats class [WPF], retrieving data
DataObject class [WPF], retrieving data
a625acf3-1144-44cd-add7-456aefc3859f

How to: Retrieve Data in a Particular Data Format

The following examples show how to retrieve data from a data object in a specified format.

Example

Description

The following example code uses the xref:System.Windows.DataObject.GetDataPresent%28System.String%29 overload to first check if a specified data format is available (natively or by auto-convert); if the specified format is available, the example retrieves the data by using the xref:System.Windows.DataObject.GetData%28System.String%29 method.

Code

[!code-csharpDragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat] [!code-vbDragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat]

Example

Description

The following example code uses the xref:System.Windows.DataObject.GetDataPresent%28System.String%2CSystem.Boolean%29 overload to first check if a specified data format is available natively (auto-convertible data formats are filtered); if the specified format is available, the example retrieves the data by using the xref:System.Windows.DataObject.GetData%28System.String%29 method.

Code

[!code-csharpDragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat_Native] [!code-vbDragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat_Native]

See also