FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ManagedDragDropService

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

    struct ManagedDragDropService
    

    Provides a lightweight, managed drag-drop state shared within the application.

    This service coordinates drag state, payload, and positions for behaviors that implement an in-process drag experience without using the drag and drop of the system.

    Deviation (DEVIATIONS.md, Behaviors): the singleton of the reference is shared by the threads of the process; the objects of the framework belong to the thread that uses them, so there is one service per thread.

    View source

    Members

    instance

    fn instance() -> Rc<ManagedDragDropService>
    

    Gets the singleton instance of the service (of the thread).

    Source

    is_dragging

    fn is_dragging(self: &Self) -> bool
    

    Gets a value indicating whether a managed drag operation is in progress.

    Source

    payload

    fn payload(self: &Self) -> Option<BoxedValue>
    

    Gets the payload being dragged.

    Source

    data_format

    fn data_format(self: &Self) -> Option<String>
    

    Gets the data format associated with the payload.

    Source

    effects

    fn effects(self: &Self) -> DragDropEffects
    

    Gets the effective drag-drop effects requested by the drag initiator.

    Source

    origin_top_level

    fn origin_top_level(self: &Self) -> Option<Ref<TopLevel>>
    

    Gets the top-level where the drag originated.

    Source

    current_client_position

    fn current_client_position(self: &Self) -> Point
    

    Gets the current pointer position in client coordinates of the origin_top_level.

    Source

    screen_position

    fn screen_position(self: &Self) -> PixelPoint
    

    Gets the current pointer position in screen pixel coordinates.

    Source

    drag_started

    fn drag_started(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
    

    Occurs when a managed drag operation begins. Disposing the returned handle unsubscribes.

    Source

    drag_ended

    fn drag_ended(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
    

    Occurs when a managed drag operation ends. Disposing the returned handle unsubscribes.

    Source

    drag_moved

    fn drag_moved(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
    

    Occurs when the pointer moves during a managed drag operation. Disposing the returned handle unsubscribes.

    Source

    begin

    fn begin(self: &Self, origin: &Ref<TopLevel>, payload: Option<BoxedValue>, data_format: Option<String>, effects: DragDropEffects, start_client: Point)
    

    Begins a managed drag operation from origin with payload in data_format, allowing effects; start_client is the starting pointer position in client coordinates.

    Source

    move_

    fn move_(self: &Self, client_position: Point)
    

    Updates the current pointer position during a managed drag operation.

    Source

    end

    fn end(self: &Self)
    

    Ends the current managed drag operation and resets state.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither

    Availability

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