Class TreeViewDragDropTarget
A drag drop target for the TreeView control.
Inheritance
Implements
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Toolkit.dll
Syntax
public class TreeViewDragDropTarget : ItemsControlDragDropTarget<ItemsControl, TreeViewItem>, IControl, IFrameworkElement, IUIElement, IDependencyObject, IAcceptDrop
Constructors
| Improve this Doc View SourceTreeViewDragDropTarget()
Initializes a new instance of the TreeViewDragDropTarget class.
Declaration
public TreeViewDragDropTarget()
Fields
| Improve this Doc View SourceExpandNodeDelayProperty
Identifies the ExpandNodeDelay dependency property.
Declaration
public static readonly DependencyProperty ExpandNodeDelayProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceExpandNodeDelay
Gets or sets the delay before expanding a node that is being hovered over during a drag operation.
Declaration
public int ExpandNodeDelay { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceCanScroll(ItemsControl)
Returns a value indicating whether a given items control can scroll.
Declaration
protected override bool CanScroll(ItemsControl itemsControl)
Parameters
Type | Name | Description |
---|---|---|
ItemsControl | itemsControl | The items control. |
Returns
Type | Description |
---|---|
System.Boolean | The value indicating whether the given items control can scroll. |
Overrides
GetDropTarget(DragEventArgs)
Retrieves the drop target of a drag event.
Declaration
protected override ItemsControl GetDropTarget(DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | args | Information about the drag event. |
Returns
Type | Description |
---|---|
ItemsControl | The drop target of a drag event. |
Overrides
GetDropTargetInsertionIndexOverride(ItemsControl, DragEventArgs)
Gets the insertion index within a drop target given information about a drag event.
Declaration
protected override int GetDropTargetInsertionIndexOverride(ItemsControl dropTarget, DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
ItemsControl | dropTarget | The drop target. |
DragEventArgs | args | Information about a drag event. |
Returns
Type | Description |
---|---|
System.Int32 | The insertion index within the drop target. |
Overrides
GetInsertionIndicatorGeometry(ItemsControl, Int32, DragEventArgs)
Returns a geometry for the insertion indicator.
Declaration
protected override Geometry GetInsertionIndicatorGeometry(ItemsControl dropTarget, int insertionIndex, DragEventArgs dragEventArgs)
Parameters
Type | Name | Description |
---|---|---|
ItemsControl | dropTarget | The drop target. |
System.Int32 | insertionIndex | The insertion index within the drop target. |
DragEventArgs | dragEventArgs | Information about the drag event. |
Returns
Type | Description |
---|---|
Geometry | The geometry for the insertion indicator. |
Overrides
GetItemsControlAncestor(DependencyObject)
Returns the items control ancestor of a dependency object.
Declaration
protected override ItemsControl GetItemsControlAncestor(DependencyObject dependencyObject)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | dependencyObject | The dependency object to retrieve the element for. |
Returns
Type | Description |
---|---|
ItemsControl | The items control ancestor of the dependency object. |
Overrides
GetTreeViewItemRectExcludingChildren(TreeViewItem)
Retrieves the location and dimensions of a TreeViewItem excluding its children.
Declaration
protected virtual Rect GetTreeViewItemRectExcludingChildren(TreeViewItem treeViewItem)
Parameters
Type | Name | Description |
---|---|---|
TreeViewItem | treeViewItem | The tree view item. |
Returns
Type | Description |
---|---|
Rect | The location and dimensions of the TreeViewItem excluding its children. |
IsTreeViewItemDraggedDirectlyAboveOrBelowSelf(DragEventArgs)
Returns a value indicating whether a TreeViewItem being dragged directly above or below itself. If there are no indices in the selection the answer is result is always true.
Declaration
protected bool IsTreeViewItemDraggedDirectlyAboveOrBelowSelf(DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | args | Information about a drag event. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the TreeViewItem being dragged directly above or below itself. |
IsTreeViewItemDraggedInDescendent(DragEventArgs)
Returns a value indicating whether an item is being dragged into its own descendent.
Declaration
protected bool IsTreeViewItemDraggedInDescendent(DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | args | Information about the drag event. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether an item is being dragged into its own descendent. If there is no index information the answer is always assumed to be true. |
OnContentChanged(Object, Object)
Throws an exception if the content is not a TreeView.
Declaration
protected override void OnContentChanged(object oldContent, object newContent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldContent | The old content value. |
System.Object | newContent | The new content value. |
Overrides
| Improve this Doc View SourceOnDragEnter(DragEventArgs)
Prevents Move, Copy, or Link actions if an item is dragged into its descendent.
Declaration
protected override void OnDragEnter(DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | args | Information about the drag event. |
Overrides
OnDragEvent(DragEventArgs)
This method is called whenever a target event is raised.
Declaration
protected override void OnDragEvent(DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | args | Information about the drag target event. |
Overrides
OnDragLeave(DragEventArgs)
Prevents Move, Copy, or Link actions if an item is dragged into its descendent.
Declaration
protected override void OnDragLeave(DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | args | Information about the drag event. |
Overrides
OnDrop(DragEventArgs)
Prevents Move, Copy, or Link actions if an item is dragged into its descendent.
Declaration
protected override void OnDrop(DragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | args | Information about the drag event. |
Overrides
ScrollIntoView(ItemsControl, TreeViewItem)
Scrolls a given item container into the view.
Declaration
protected override void ScrollIntoView(ItemsControl itemsControl, TreeViewItem itemContainer)
Parameters
Type | Name | Description |
---|---|---|
ItemsControl | itemsControl | The items control that contains the item container. |
TreeViewItem | itemContainer | The item container to scroll into view. |