Skip to content

Commit

Permalink
Added documentation for Drag and Drop samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Harikm committed Aug 16, 2015
1 parent 02a847a commit 66f6f94
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 49 deletions.
14 changes: 7 additions & 7 deletions Drag and Drop/DragDropDataFormats/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

# %Sample% sample
# Data Formats Spy Sample
This sample displays the data formats contained in any item dropped on the sample. Methods demonstrated in this sample include:
- GetData
- GetDataPresent

This sample shows how to use the %objective

## Remarks
In this sample, a simple event handler monitors the PreviewDrop event on a TextBox. When a drop is detected, the data formats present in the dropped data object are displayed using the GetFormats method.
The TextBox control includes native drop handling for text-based data; this sample overrides native drop support by setting the Handled property on the PreviewDrop event to true. Note that with routed events, tunneling events (by convention, prefixed with "Preview") first propagate down through the element tree, and then bubbling events propagate back up through the element tree. Marking the tunneling PreviewDrop event as handled causes the native drop handler to skip handling the corresponding bubbling Drop event.

In addition to listing data formats in a dropped item, the sample includes the ability to filter-out non-native data formats (that is, data formats that are available through automatic data-conversion), and labels each data format as "native" or "autoconvert". The GetDataPresent method is used to differentiate between native and auto-convertable data formats.

## Build the sample

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in [Visual Studio 2015](https://www.visualstudio.com/wpf-vs).

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.

21 changes: 15 additions & 6 deletions Drag and Drop/DragDropEvents/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@

# %Sample% sample
# Drag-and-Drop Events Explorer Sample
This sample explores how and when common drag and drop events fire. Events demonstrated in this sample include:

This sample shows how to use the %objective
###Bubbling
- DragEnter
- DragLeave
- DragOver
- Drop

## Remarks
###Tunneling
- PreviewDragEnter
- PreviewDragLeave
- PreviewDragOver
- PreviewDrop

The sample provides a UIElement (which happens to be a TextBlock) that is configured to be the target of a drag-and-drop operation; this drop-target support is enabled by setting the AllowDrop attribute to true on the target element, which can be a UIElement or a ContentElement.
Simple event handlers are attached to the UIElement for each of the drag-and-drop events listed in the table above. Whenever any of these events fires, a log entry is written to a log window included in the sample. The sample supports both brief and verbose event logging.
To observe when and in what order the events fire, drag any object into, over, or out of the bounds of the drop-target area, or drop any object on the drop-target area.

## Build the sample

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in [Visual Studio 2015](https://www.visualstudio.com/wpf-vs).

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.

12 changes: 3 additions & 9 deletions Drag and Drop/DragDropObjects/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@

# %Sample% sample

This sample shows how to use the %objective

## Remarks

# Create a Data Object from a Text Selection Sample
This sample creates a data object from a text selection.
The user is able to use the mouse to select provided sample text in a TextBox, and then click a button to create a data object that contains the text selection. One of the DataObject constructors is used to create the data object and specify the contained data and corresponding data format. The DataFormats class provides a static type string that is used to specify the data format as "Text". Finally, the sample displays the native data formats and corresponding data stored in the newly-created data object.

## Build the sample

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in [Visual Studio 2015](https://www.visualstudio.com/wpf-vs).

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.

14 changes: 5 additions & 9 deletions Drag and Drop/DragDropOpenTextFile/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@

# %Sample% sample

This sample shows how to use the %objective

## Remarks

# Load a Dropped File Sample
This sample will open and display the contents of a file dropped on the sample. Methods demonstrated in this sample include:
- GetData
- GetDataPresent
In this sample, event handlers monitor the PreviewDragOver and PreviewDrop events on a TextBox. When an object is dragged over the TextBox, a PreviewDragOver event handler checks to see if the object is a single file, and adjusts the DragDropEffects to indicate that a single file can be dropped, and anything else cannot. When a single file is dropped on the TextBox, a PreviewDrop event handler displays the file contents in the TextBox.

## Build the sample

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in [Visual Studio 2015](https://www.visualstudio.com/wpf-vs).

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.

11 changes: 2 additions & 9 deletions Drag and Drop/DragDropTextOps/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@

# %Sample% sample

This sample shows how to use the %objective

## Remarks

# Drag and Drop an Object on a Canvas
This example shows how to move objects on a Canvas using drag and drop. In addition, this sample shows how to apply an adorner and an animation to the object as it is being moved.

## Build the sample

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in [Visual Studio 2015](https://www.visualstudio.com/wpf-vs).

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.

11 changes: 2 additions & 9 deletions Drag and Drop/DragDropThumbOps/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@

# %Sample% sample

This sample shows how to use the %objective

## Remarks

# Thumb Drag Functionality Sample
This example shows how to use a Thumb to resize a Canvas control by responding to the DragDelta event.

## Build the sample

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in [Visual Studio 2015](https://www.visualstudio.com/wpf-vs).

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.

0 comments on commit 66f6f94

Please sign in to comment.