Skip to main content

ferroui_xaml_interactions_draggable/
lib.rs

1//! ferroui-xaml-interactions-draggable
2//!
3//! Behaviors that drag elements in place, ported from the `Xaml.Behaviors.Interactions.Draggable`
4//! project of Xaml.Behaviors (see `NOTICE.md`):
5//!
6//! - [`CanvasDragBehavior`]: moves a child of a canvas with the pointer;
7//! - [`GridDragBehavior`]: swaps the cells of a child of a grid with the child under the pointer;
8//! - [`ItemDragBehavior`] and [`ListReorderDragBehavior`]: reorder the items of an items control,
9//!   the second with a placeholder at the insertion point;
10//! - [`MouseDragElementBehavior`] and [`MultiMouseDragElementBehavior`]: move one or several
11//!   controls by a translation;
12//! - [`AutoScrollDuringDragBehavior`]: scrolls a scroll viewer while the pointer is dragged near
13//!   its edges;
14//! - [`SelectionAdorner`]: the corner handles shown over a dragged element.
15//!
16//! The styles of the reference (`Styles.xaml`) make tab controls, list boxes, canvases and grids
17//! with the class `draggable` draggable; the build of the crate compiles them, and an application
18//! includes them with
19//! `<StyleInclude Source="ferres://FerroUI.Xaml.Interactions.Draggable/Styles.xaml" />`.
20//!
21//! The namespace of the crate is `FerroUI.Xaml.Interactions.Draggable`, mapped into the default
22//! XML namespace of the framework: documents name its types without a prefix once
23//! [`register_types`] ran.
24
25// The compiled markup names the types of the crate by the name of the crate, as the markup of any
26// other crate does.
27extern crate self as ferroui_xaml_interactions_draggable;
28
29// `compiled_xaml` (the compiled markup of the styles document) and `compiled_markup` (the loader
30// table of the crate and `register()`), which the build script generates.
31ferroui_markup_xaml::include_compiled_xaml!();
32
33#[cfg(any(test, feature = "document-assets"))]
34mod assets;
35mod auto_scroll_during_drag_behavior;
36mod canvas_drag_behavior;
37mod grid_drag_behavior;
38mod item_drag_behavior;
39mod list_reorder_drag_behavior;
40mod mouse_drag_element_behavior;
41mod multi_mouse_drag_element_behavior;
42mod register_types;
43mod routed_handlers;
44mod rust_paths;
45mod selection_adorner;
46
47pub use auto_scroll_during_drag_behavior::AutoScrollDuringDragBehavior;
48pub use canvas_drag_behavior::CanvasDragBehavior;
49pub use grid_drag_behavior::GridDragBehavior;
50pub use item_drag_behavior::ItemDragBehavior;
51pub use list_reorder_drag_behavior::ListReorderDragBehavior;
52pub use mouse_drag_element_behavior::MouseDragElementBehavior;
53pub use multi_mouse_drag_element_behavior::MultiMouseDragElementBehavior;
54pub use register_types::{register_types, ASSEMBLY};
55pub use selection_adorner::SelectionAdorner;
56
57#[cfg(test)]
58mod tests;