Skip to main content

Crate ferroui_static_view_locator_macros

Crate ferroui_static_view_locator_macros 

Source
Expand description

ferroui-static-view-locator-macros

The attributes of ferroui-static-view-locator: static_view_locator ([StaticViewLocator]) and static_view_mapping ([StaticViewMapping]). Use them through ferroui_static_view_locator, which re-exports them.

The attributes do not generate the locator: a proc macro sees one item and cannot find the view models and views of the crate. The build script of the crate does (ferroui-static-view-locator-build), and writes one file per locator below OUT_DIR; static_view_locator checks its options, writes the struct, and includes that file, whose impl blocks extend the struct (the partial class of the reference).

Attribute Macrosยง

static_view_locator
Makes a struct a view locator generated at build time ([StaticViewLocator]).
static_view_mapping
Maps a view model type to a view type on a locator ([StaticViewMapping(typeof(VM), typeof(V))]): the final override of the mapping of the view model, for types that do not follow the naming rules. Repeatable; the types are named as in the module of the locator.