pub struct ItemsSourceView { /* private fields */ }Expand description
Represents a standardized view of the supported interactions between an items collection and an items control.
Implementations§
Source§impl ItemsSourceView
impl ItemsSourceView
Sourcepub fn empty() -> Rc<ItemsSourceView>
pub fn empty() -> Rc<ItemsSourceView>
Gets an empty ItemsSourceView.
Sourcepub fn source(&self) -> ItemsSource
pub fn source(&self) -> ItemsSource
Gets the source collection.
Sourcepub fn add_collection_changed(&self, handler: Rc<ItemsChangedHandler>) -> u64
pub fn add_collection_changed(&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.
pub fn remove_collection_changed(&self, token: u64)
Sourcepub fn get_at(&self, index: usize) -> Option<BoxedValue>
pub fn get_at(&self, index: usize) -> Option<BoxedValue>
Retrieves the item at the specified index. Panics if out of range.
Sourcepub fn contains(&self, item: &Option<BoxedValue>) -> bool
pub fn contains(&self, item: &Option<BoxedValue>) -> bool
Whether the collection contains the item.
Sourcepub fn index_of(&self, item: &Option<BoxedValue>) -> i32
pub fn index_of(&self, item: &Option<BoxedValue>) -> i32
The index of the item, or -1.
Sourcepub fn get_or_create(items: Option<&ItemsSource>) -> Rc<ItemsSourceView>
pub fn get_or_create(items: Option<&ItemsSource>) -> Rc<ItemsSourceView>
Gets or creates an ItemsSourceView for the specified source.
Returns empty if items is None, otherwise a new
view. (A caller that already holds a view uses it as is.)
Sourcepub fn get_or_create_of<T: PropertyValue>(
items: Option<&ItemsSource>,
) -> ItemsSourceViewOf<T>
pub fn get_or_create_of<T: PropertyValue>( items: Option<&ItemsSource>, ) -> ItemsSourceViewOf<T>
Gets or creates a typed view for the specified source.
Sourcepub fn iter(&self) -> impl Iterator<Item = Option<BoxedValue>>
pub fn iter(&self) -> impl Iterator<Item = Option<BoxedValue>>
The items, enumerated by index over the live collection.
Sourcepub fn to_vec(&self) -> Vec<Option<BoxedValue>>
pub fn to_vec(&self) -> Vec<Option<BoxedValue>>
A copy of the items.
Trait Implementations§
Source§impl ICollectionChangedListener for ItemsSourceView
impl ICollectionChangedListener for ItemsSourceView
fn pre_changed(&self, e: &ItemsChangedEventArgs<'_>)
fn changed(&self, e: &ItemsChangedEventArgs<'_>)
fn post_changed(&self, e: &ItemsChangedEventArgs<'_>)
Auto Trait Implementations§
impl !Freeze for ItemsSourceView
impl !RefUnwindSafe for ItemsSourceView
impl !Send for ItemsSourceView
impl !Sync for ItemsSourceView
impl !UnwindSafe for ItemsSourceView
impl Unpin for ItemsSourceView
impl UnsafeUnpin for ItemsSourceView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more