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.
Members
instanceis_draggingpayloaddata_formateffectsorigin_top_levelcurrent_client_positionscreen_positiondrag_starteddrag_endeddrag_movedbeginmove_end
instance
fn instance() -> Rc<ManagedDragDropService>
Gets the singleton instance of the service (of the thread).
is_dragging
fn is_dragging(self: &Self) -> bool
Gets a value indicating whether a managed drag operation is in progress.
payload
fn payload(self: &Self) -> Option<BoxedValue>
Gets the payload being dragged.
data_format
fn data_format(self: &Self) -> Option<String>
Gets the data format associated with the payload.
effects
fn effects(self: &Self) -> DragDropEffects
Gets the effective drag-drop effects requested by the drag initiator.
origin_top_level
fn origin_top_level(self: &Self) -> Option<Ref<TopLevel>>
Gets the top-level where the drag originated.
current_client_position
fn current_client_position(self: &Self) -> Point
Gets the current pointer position in client coordinates of the
origin_top_level.
screen_position
fn screen_position(self: &Self) -> PixelPoint
Gets the current pointer position in screen pixel coordinates.
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.
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.
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.
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.
move_
fn move_(self: &Self, client_position: Point)
Updates the current pointer position during a managed drag operation.
end
fn end(self: &Self)
Ends the current managed drag operation and resets state.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.