Skip to main content

ferroui_xaml_interactions_responsive/
lib.rs

1//! ferroui-xaml-interactions-responsive
2//!
3//! Behaviors that switch style classes by the size of a control, ported from the
4//! `Xaml.Behaviors.Interactions.Responsive` project of Xaml.Behaviors (see `NOTICE.md`):
5//!
6//! - [`AdaptiveBehavior`] observes the bounds of its control (or of its source control) and adds
7//!   or removes the class of each of its [`AdaptiveClassSetter`]s as the width and the height
8//!   meet the minimum and maximum of the setter;
9//! - [`AspectRatioBehavior`] does the same with the ratio of the width to the height and the
10//!   minimum and maximum ratios of its [`AspectRatioClassSetter`]s.
11//!
12//! The namespace of the crate is `FerroUI.Xaml.Interactions.Responsive`, mapped into the default
13//! XML namespace of the framework: documents name its types without a prefix once
14//! [`register_types`] ran.
15
16mod adaptive_behavior;
17mod adaptive_class_setter;
18mod aspect_ratio_behavior;
19mod aspect_ratio_class_setter;
20mod markup_types;
21mod register_types;
22mod rust_paths;
23
24pub use crate::adaptive_behavior::{AdaptiveBehavior, AdaptiveClassSetters};
25pub use crate::adaptive_class_setter::AdaptiveClassSetter;
26pub use crate::aspect_ratio_behavior::{AspectRatioBehavior, AspectRatioClassSetters};
27pub use crate::aspect_ratio_class_setter::AspectRatioClassSetter;
28pub use crate::register_types::{register_types, ASSEMBLY};
29
30#[cfg(test)]
31mod tests;