C# Class Yuhan.WPF.DragDrop.DragDropFrameworkData.StringToCanvasTextBlock

This data consumer looks for an object of type string. When the item is dropped, a TextBlock is created with its text initialized to the contents of the data string. The TextBlock's origin is placed on the canvas at the point where the string was dropped.
Inheritance: Yuhan.WPF.DragDrop.DragDropFramework.DataConsumerBase, IDataConsumer
显示文件 Open project: hansuky/Yuhan Class Usage Examples

Public Methods

Method Description
DropTarget_DragEnter ( object sender, System.Windows.DragEventArgs e ) : void
DropTarget_DragOver ( object sender, System.Windows.DragEventArgs e ) : void
DropTarget_Drop ( object sender, System.Windows.DragEventArgs e ) : void
StringToCanvasTextBlock ( string dataFormats ) : System

Create a string data consumer for a canvas

Private Methods

Method Description
DragOverOrDrop ( bool bDrop, object sender, System.Windows.DragEventArgs e ) : void

First determine whether the drag data is supported. Finally handle the actual drop when bDrop is true by creating a new TextBlock and initializing its Text property to the value of the string. The TextBlock is placed on the canvas such that its origin is at the point when the string was dropped.

Method Details

DropTarget_DragEnter() public method

public DropTarget_DragEnter ( object sender, System.Windows.DragEventArgs e ) : void
sender object
e System.Windows.DragEventArgs
return void

DropTarget_DragOver() public method

public DropTarget_DragOver ( object sender, System.Windows.DragEventArgs e ) : void
sender object
e System.Windows.DragEventArgs
return void

DropTarget_Drop() public method

public DropTarget_Drop ( object sender, System.Windows.DragEventArgs e ) : void
sender object
e System.Windows.DragEventArgs
return void

StringToCanvasTextBlock() public method

Create a string data consumer for a canvas
public StringToCanvasTextBlock ( string dataFormats ) : System
dataFormats string A data format whose data is of type string
return System