Class DragDropTarget<TItemsControlType, TItemContainerType>
A control that enabled drag and drop operations on an ItemsControl.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public abstract class DragDropTarget<TItemsControlType, TItemContainerType> : ContentControl where TItemsControlType : UIElement where TItemContainerType : UIElement
Type Parameters
Name | Description |
---|---|
TItemsControlType | The type of the items control. |
TItemContainerType | The type of the item container. |
Constructors
| Improve this Doc View SourceDragDropTarget()
Initializes a new instance of the DragDropTarget class.
Declaration
protected DragDropTarget()
Fields
| Improve this Doc View SourceAllowedSourceEffectsProperty
Identifies the AllowedSourceEffects dependency property.
Declaration
public static readonly DependencyProperty AllowedSourceEffectsProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceAllowedSourceEffects
Gets or sets the allowed effects when this DragDropTarget is the drag source.
Declaration
[NotImplemented]
public DragDropEffects AllowedSourceEffects { get; set; }
Property Value
Type | Description |
---|---|
DragDropEffects |
Methods
| Improve this Doc View SourceAddItem(TItemsControlType, Object)
Adds an item to an items control.
Declaration
protected abstract void AddItem(TItemsControlType control, object data)
Parameters
Type | Name | Description |
---|---|---|
TItemsControlType | control | The items control. |
System.Object | data | The data to be inserted. |
ContainerFromIndex(TItemsControlType, Int32)
Retrieves the item container at a given index.
Declaration
protected abstract UIElement ContainerFromIndex(TItemsControlType itemsControl, int index)
Parameters
Type | Name | Description |
---|---|---|
TItemsControlType | itemsControl | The items control. |
System.Int32 | index | The index at which to retrieve the container. |
Returns
Type | Description |
---|---|
UIElement | The item container at a given index. |
IndexFromContainer(TItemsControlType, UIElement)
Retrieves the index of an item container.
Declaration
protected abstract int? IndexFromContainer(TItemsControlType itemsControl, UIElement itemContainer)
Parameters
Type | Name | Description |
---|---|---|
TItemsControlType | itemsControl | The items control. |
UIElement | itemContainer | The item container. |
Returns
Type | Description |
---|---|
System.Nullable<System.Int32> | The index of an item container. |
InsertItem(TItemsControlType, Int32, Object)
Inserts an item into an items control.
Declaration
protected abstract void InsertItem(TItemsControlType itemsControl, int index, object data)
Parameters
Type | Name | Description |
---|---|---|
TItemsControlType | itemsControl | The items control. |
System.Int32 | index | The index at which to insert the item. |
System.Object | data | The data to be inserted. |
INTERNAL_OnAttachedToVisualTree()
Declaration
protected override void INTERNAL_OnAttachedToVisualTree()
Overrides
| Improve this Doc View SourceINTERNAL_ReturnNewTItemsControl()
Create a new TItemsControlType
Declaration
protected abstract TItemsControlType INTERNAL_ReturnNewTItemsControl()
Returns
Type | Description |
---|---|
TItemsControlType | A new TItemsControlType |
OnDragOver(DragEventArgs)
Raises the DragOver event.
Declaration
protected virtual void OnDragOver(DragEventArgs dragOverEventArgs)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | dragOverEventArgs | Information about the event. |
RemoveItem(TItemsControlType, Object)
Removes an item from an items control.
Declaration
protected abstract void RemoveItem(TItemsControlType itemsControl, object data)
Parameters
Type | Name | Description |
---|---|---|
TItemsControlType | itemsControl | The items control. |
System.Object | data | The data to be removed. |
RemoveItemAtIndex(TItemsControlType, Int32)
Removes data from an ItemsControl.
Declaration
protected abstract void RemoveItemAtIndex(TItemsControlType itemsControl, int index)
Parameters
Type | Name | Description |
---|---|---|
TItemsControlType | itemsControl | The items control. |
System.Int32 | index | The index at which to remove an item. |
Events
| Improve this Doc View SourceDragEnter
Raises the DragEnter event.
Declaration
public event DragEventHandler DragEnter
Event Type
Type | Description |
---|---|
DragEventHandler |
DragLeave
Raises the DragLeave event.
Declaration
public event DragEventHandler DragLeave
Event Type
Type | Description |
---|---|
DragEventHandler |
DragOver
Raises the DragOver event.
Declaration
public event DragEventHandler DragOver
Event Type
Type | Description |
---|---|
DragEventHandler |
Drop
Raises the Drop event
Declaration
public event DragEventHandler Drop
Event Type
Type | Description |
---|---|
DragEventHandler |
ItemDragCompleted
Fires when the DragDropTarget control loses mouse capture.
Declaration
public event EventHandler<ItemDragEventArgs> ItemDragCompleted
Event Type
Type | Description |
---|---|
System.EventHandler<ItemDragEventArgs> |
ItemDragStarting
An event raised when a drag operation is starting on an item.
Declaration
public event EventHandler<ItemDragEventArgs> ItemDragStarting
Event Type
Type | Description |
---|---|
System.EventHandler<ItemDragEventArgs> |
ItemDroppedOnSource
Raises the ItemDroppedOnSource event
Declaration
public event DragEventHandler ItemDroppedOnSource
Event Type
Type | Description |
---|---|
DragEventHandler |
ItemDroppedOnTarget
Raises the ItemDroppedOnTarget event
Declaration
[NotImplemented]
public event EventHandler<ItemDragEventArgs> ItemDroppedOnTarget
Event Type
Type | Description |
---|---|
System.EventHandler<ItemDragEventArgs> |