# BaseTreeViewDropHandler

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/trait-basetreeviewdrophandler/

**trait** · [`ferroui-xaml-interactions-draganddrop`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/) · v0.5.0

```rust
trait BaseTreeViewDropHandler
```

Provides base drag-and-drop visuals and validation helpers for `TreeView` scenarios: while an
item is dragged over a tree view, the item under the pointer gets the class `DraggingUp` or
`DraggingDown` (the half of the item the pointer is over), or `TargetHighlight` when the dragged
item would move to another parent (the styles document of the crate styles these classes).

Deviation (DEVIATIONS.md, Behaviors): the abstract class of the reference is a trait, and every
type that implements it is a [`DropHandlerBase`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/trait-drophandlerbase/) with the validation, execution and cancellation
of the class; the abstract overload `Validate(TreeView, ..)` of the reference is
`validate_tree_view`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/behaviors/base_tree_view_drop_handler.rs#L23)

## Members

- [`validate_tree_view`](#function-validate_tree_view)

<a id="function-validate_tree_view"></a>

### validate_tree_view

```rust
fn validate_tree_view(self: &Self, tree_view: &Ref<TreeView>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>, execute: bool) -> (bool, bool)
```

Validates a pending tree-view drag operation and optionally executes it (when `execute`).

Returns whether the operation is valid, and whether the source item will be moved to a
different parent.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/behaviors/base_tree_view_drop_handler.rs#L28)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
