FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ItemsSourceView

    struct · ferroui-controls · v0.5.0

    struct ItemsSourceView
    

    Represents a standardized view of the supported interactions between an items collection and an items control.

    View source

    Members

    empty

    fn empty() -> Rc<ItemsSourceView>
    

    Gets an empty ItemsSourceView.

    Source

    new

    fn new(source: ItemsSource) -> Rc<Self>
    

    Initializes a new instance of the view for the specified data source.

    Source

    count

    fn count(self: &Self) -> usize
    

    Gets the number of items in the collection.

    Source

    has_key_index_mapping

    fn has_key_index_mapping(self: &Self) -> bool
    

    Gets a value that indicates whether the items source can provide a unique key for each item: whether the source implements IKeyIndexMapping (WinUI ItemsSourceView.HasKeyIndexMapping).

    Source

    key_from_index

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

    Retrieves the unique key of the item at index from the items source (WinUI ItemsSourceView.KeyFromIndex).

    Panics if the source does not implement IKeyIndexMapping (WinUI throws hresult_not_implemented), or if index is not the index of an item.

    Source

    index_from_key

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

    Retrieves the index of the item that has the unique key key, or -1 when no item has it (WinUI ItemsSourceView.IndexFromKey).

    Panics if the source does not implement IKeyIndexMapping (WinUI throws hresult_not_implemented).

    Source

    source

    fn source(self: &Self) -> ItemsSource
    

    Gets the source collection.

    Source

    add_collection_changed

    fn add_collection_changed(self: &Self, handler: Rc<ItemsChangedHandler>) -> u64
    

    Occurs when the collection has changed to indicate the reason for the change and which items changed. Returns the token for remove_collection_changed.

    Source

    remove_collection_changed

    fn remove_collection_changed(self: &Self, token: u64)
    

    Source

    get_at

    fn get_at(self: &Self, index: usize) -> Option<BoxedValue>
    

    Retrieves the item at the specified index. Panics if out of range.

    Source

    contains

    fn contains(self: &Self, item: &Option<BoxedValue>) -> bool
    

    Whether the collection contains the item.

    Source

    index_of

    fn index_of(self: &Self, item: &Option<BoxedValue>) -> i32
    

    The index of the item, or -1.

    Source

    get_or_create

    fn get_or_create(items: Option<&ItemsSource>) -> Rc<ItemsSourceView>
    

    Gets or creates an ItemsSourceView for the specified source.

    Returns empty if items is None, the view itself if items is a view (ItemsSourceView isv => isv), otherwise a new view.

    Source

    get_or_create_of

    fn get_or_create_of<T: PropertyValue>(items: Option<&ItemsSource>) -> ItemsSourceViewOf<T>
    

    Gets or creates a typed view for the specified source.

    Source

    iter

    fn iter(self: &Self) -> impl Iterator<Item = Option<BoxedValue>>
    

    The items, enumerated by index over the live collection.

    Source

    to_vec

    fn to_vec(self: &Self) -> Vec<Option<BoxedValue>>
    

    A copy of the items.

    Source

    Trait implementations

    Availability

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