FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IKeyIndexMapping

    trait · ferroui-controls · v0.5.0

    trait IKeyIndexMapping
    

    Provides methods that let an items source give each item a unique key, which stays the same while the item is in the source, whatever its index (WinUI IKeyIndexMapping).

    An IItemsList states that it implements the contract through key_index_mapping; ItemsSourceView::has_key_index_mapping reports it, and a control that realizes items can keep the element of an item across a reset of the source by its key.

    View source

    Members

    key_from_index

    fn key_from_index(self: &Self, index: i32) -> String
    

    Retrieves the unique key of the item at the specified index.

    Source

    index_from_key

    fn index_from_key(self: &Self, key: &str) -> i32
    

    Retrieves the index of the item that has the specified unique key, or -1 when no item has it.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.