Skip to main content

ferroui_xaml_interactivity/
lib.rs

1//! ferroui-xaml-interactivity
2//!
3//! The object model of the behaviors of FerroUI, ported from the `Xaml.Behaviors.Interactivity`
4//! project of Xaml.Behaviors (see `NOTICE.md`):
5//!
6//! - the attached property [`Interaction::behaviors_property`] and its [`BehaviorCollection`],
7//!   which attaches its behaviors to the host and replays the lifecycle of the host to them
8//!   (initialized, attached to the logical tree, attached to the visual tree, loaded), phase by
9//!   phase across the behaviors, including the behaviors added while it does so;
10//! - the contracts [`IBehavior`], [`ITrigger`], [`IAction`], [`IReversibleAction`] and
11//!   [`IBehaviorEventsHandler`];
12//! - the behaviors, triggers and actions that are plain objects ([`Behavior`], [`Trigger`],
13//!   [`Action`]) and the ones that are styled elements and join the logical tree of their host
14//!   ([`StyledElementBehavior`], [`StyledElementTrigger`], [`StyledElementAction`]), with their
15//!   typed forms ([`BehaviorOfT`], [`StyledElementBehaviorOfT`], ..);
16//! - the base classes of event triggers, command behaviors and actions, and disposing behaviors;
17//! - the templates that let a style set behaviors and actions ([`BehaviorCollectionTemplate`],
18//!   [`ActionCollectionTemplate`]) or other objects ([`ObjectTemplate`], [`NotificationTemplate`]);
19//! - the helpers the other behavior crates use: properties and methods by name, conversions and
20//!   comparisons of untyped values, command state, reversible property changes.
21//!
22//! The namespace of the crate is `FerroUI.Xaml.Interactivity`, mapped into the default XML
23//! namespace of the framework: documents name its types without a prefix once
24//! [`register_types`] ran.
25
26mod actions;
27mod behaviors;
28mod collections;
29mod contract;
30mod core;
31mod disposable_action;
32mod events;
33mod ferro_object;
34mod ferro_object_behaviors_extensions;
35pub mod helpers;
36mod interaction;
37mod markup_types;
38mod register_types;
39mod rust_paths;
40mod styled_element;
41mod templates;
42mod triggers;
43
44pub use crate::actions::InvokeCommandActionBase;
45pub use crate::behaviors::{
46    DisposingBehavior, DisposingBehaviorImpl, DisposingBehaviorImplExt, DisposingBehaviorVTable, InteractiveBehaviorBase,
47    InvokeCommandBehaviorBase,
48};
49pub use crate::collections::{ActionCollection, BehaviorCollection};
50pub use crate::contract::{
51    ComparisonConditionType, IAction, IBehavior, IBehaviorEventsHandler, IReversibleAction, ITrigger,
52};
53pub use crate::core::{Condition, ConditionCollection};
54pub use crate::disposable_action::DisposableAction;
55pub use crate::events::{
56    AddEventHandlerCallback, AddEventHandlerRegistry, EventArgsValue, EventHandler, FuncAddEventHandler, IAddEventHandler,
57};
58pub use crate::ferro_object::{
59    Action, ActionImpl, ActionImplExt, ActionVTable, Behavior, BehaviorImpl, BehaviorImplExt, BehaviorOfT, BehaviorVTable,
60    Trigger, TriggerOfT,
61};
62pub use crate::ferro_object_behaviors_extensions::FerroObjectBehaviorsExtensions;
63pub use crate::helpers::{CommandCanExecuteObserver, ReversiblePropertyChange};
64pub use crate::interaction::Interaction;
65pub use crate::register_types::{register_types, ASSEMBLY};
66pub use crate::styled_element::{
67    IActionLogicalTreeLifecycle, StyledElementAction, StyledElementActionImpl, StyledElementActionImplExt,
68    StyledElementActionVTable, StyledElementBehavior, StyledElementBehaviorImpl, StyledElementBehaviorImplExt,
69    StyledElementBehaviorOfT, StyledElementBehaviorVTable, StyledElementTrigger, StyledElementTriggerOfT,
70};
71pub use crate::templates::{ActionCollectionTemplate, BehaviorCollectionTemplate, NotificationTemplate, ObjectTemplate};
72pub use crate::triggers::{
73    DisposingTrigger, DisposingTriggerImpl, DisposingTriggerImplExt, DisposingTriggerVTable, EventTriggerBase,
74    EventTriggerBaseImpl, EventTriggerBaseImplExt, EventTriggerBaseVTable, InteractiveTriggerBase,
75};
76
77#[cfg(test)]
78mod tests;