FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    DropHandlerBase

    trait · ferroui-xaml-interactions-draganddrop · v0.5.0

    trait DropHandlerBase
    

    Provides helper methods for custom drop handlers.

    Deviation (DEVIATIONS.md, Behaviors): the abstract class of the reference is a trait whose methods have the bodies of the virtual methods of the class, and every type that implements it is an IDropHandler. A handler overrides validate and execute (and the others when it needs to); an override calls the body of the base class through the base_* method of the same name. The IList<T> helpers work on a FerroList, and the overloads of MoveItem and SwapItem that take two collections are move_item_between and swap_item_between. Call the methods with the trait named (DropHandlerBase::enter(handler, ..)) where IDropHandler is in scope too: the two traits have the same method names.

    View source

    Members

    move_item

    fn move_item<T: Clone>(self: &Self, items: &FerroList<T>, source_index: usize, target_index: usize)
    where Self: Sized
    

    Moves an item within a collection.

    Source

    move_item_between

    fn move_item_between<T: Clone>(self: &Self, source_items: &FerroList<T>, target_items: &FerroList<T>, source_index: usize, target_index: usize)
    where Self: Sized
    

    Moves an item from one collection to another.

    Source

    swap_item

    fn swap_item<T: Clone + PartialEq>(self: &Self, items: &FerroList<T>, source_index: usize, target_index: usize)
    where Self: Sized
    

    Swaps two items inside a collection.

    Source

    swap_item_between

    fn swap_item_between<T: Clone + PartialEq>(self: &Self, source_items: &FerroList<T>, target_items: &FerroList<T>, source_index: usize, target_index: usize)
    where Self: Sized
    

    Swaps an item of one collection with an item of another.

    Source

    insert_item

    fn insert_item<T: Clone>(self: &Self, items: &FerroList<T>, item: T, index: usize)
    where Self: Sized
    

    Inserts an item into a collection at the specified index.

    Source

    enter

    fn enter(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
    

    Called when a drag enters the target.

    Source

    base_enter

    fn base_enter(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
    

    The body of enter of the base class: the effects the target accepts, from validate.

    Source

    over

    fn over(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
    

    Called continuously while a drag is over the target.

    Source

    base_over

    fn base_over(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
    

    The body of over of the base class: the effects the target accepts, from validate.

    Source

    drop

    fn drop(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
    

    Called when the drag is dropped on the target.

    Source

    base_drop

    fn base_drop(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
    

    The body of drop of the base class: the effects of the drop, from execute.

    Source

    leave

    fn leave(self: &Self, sender: Option<&BoxedValue>, e: &RoutedEventArgs)
    

    Called when the drag leaves the target.

    Source

    base_leave

    fn base_leave(self: &Self, sender: Option<&BoxedValue>, e: &RoutedEventArgs)
    

    The body of leave of the base class: cancel.

    Source

    validate

    fn validate(self: &Self, _sender: Option<&BoxedValue>, _e: &DragEventArgs, _source_context: Option<&BoxedValue>, _target_context: Option<&BoxedValue>, _state: Option<&BoxedValue>) -> bool
    

    Validates whether the drag operation can be performed.

    Source

    execute

    fn execute(self: &Self, _sender: Option<&BoxedValue>, _e: &DragEventArgs, _source_context: Option<&BoxedValue>, _target_context: Option<&BoxedValue>, _state: Option<&BoxedValue>) -> bool
    

    Executes the drop operation.

    Source

    cancel

    fn cancel(self: &Self, _sender: Option<&BoxedValue>, _e: &RoutedEventArgs)
    

    Cancels the drag operation.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.