Table of Contents

Class ListBoxItemCollection

Namespace
nanoFramework.Presentation.Controls
Assembly
nanoFramework.Graphics.dll
public class ListBoxItemCollection : ICollection, IEnumerable
Inheritance
ListBoxItemCollection
Implements
Inherited Members
Extension Methods

Constructors

ListBoxItemCollection(ListBox, UIElementCollection)

Initializes a new instance of the ListBoxItemCollection class.

public ListBoxItemCollection(ListBox listBox, UIElementCollection items)

Parameters

listBox ListBox

The ListBox that owns the ListBoxItemCollection.

items UIElementCollection

The UIElementCollection to use as the basis for the ListBoxItemCollection.

Properties

Count

Gets the number of elements contained in the collection.

public int Count { get; }

Property Value

int

IsSynchronized

Gets a value indicating whether access to the collection is synchronized (thread-safe).

public bool IsSynchronized { get; }

Property Value

bool

this[int]

Gets or sets the ListBoxItem at the specified index.

public ListBoxItem this[int index] { get; set; }

Parameters

index int

The zero-based index of the ListBoxItem to get or set.

Property Value

ListBoxItem

The ListBoxItem at the specified index.

SyncRoot

Gets an object that can be used to synchronize access to the collection.

public object SyncRoot { get; }

Property Value

object

Methods

Add(ListBoxItem)

Adds a ListBoxItem to the end of the ListBoxItemCollection.

public int Add(ListBoxItem item)

Parameters

item ListBoxItem

The ListBoxItem to add to the ListBoxItemCollection.

Returns

int

The zero-based index of the ListBoxItem that was added to the ListBoxItemCollection.

Add(UIElement)

Adds a UIElement to the end of the ListBoxItemCollection.

public int Add(UIElement element)

Parameters

element UIElement

The UIElement to add to the ListBoxItemCollection.

Returns

int

The zero-based index of the ListBoxItem that was added to the ListBoxItemCollection.

Clear()

Removes all items from the ListBoxItemCollection.

public void Clear()

Contains(ListBoxItem)

Determines whether the ListBoxItemCollection contains a specific ListBoxItem.

public bool Contains(ListBoxItem item)

Parameters

item ListBoxItem

The ListBoxItem to locate in the ListBoxItemCollection.

Returns

bool

true if the ListBoxItem is found in the ListBoxItemCollection; otherwise, false.

CopyTo(Array, int)

Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.

public void CopyTo(Array array, int index)

Parameters

array Array

The one-dimensional array that is the destination of the elements copied from the collection.

index int

The zero-based index in the destination array at which copying begins.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator GetEnumerator()

Returns

IEnumerator

An enumerator that iterates through the collection.

IndexOf(ListBoxItem)

Determines the index of a specific ListBoxItem in the ListBoxItemCollection.

public int IndexOf(ListBoxItem item)

Parameters

item ListBoxItem

The ListBoxItem to locate in the ListBoxItemCollection.

Returns

int

The zero-based index of the ListBoxItem within the ListBoxItemCollection; otherwise, -1.

Insert(int, ListBoxItem)

Inserts a ListBoxItem into the ListBoxItemCollection at the specified index.

public void Insert(int index, ListBoxItem item)

Parameters

index int

The zero-based index at which the ListBoxItem should be inserted.

item ListBoxItem

The ListBoxItem to insert into the ListBoxItemCollection.

Remove(ListBoxItem)

Removes the specified ListBoxItem from the collection.

public void Remove(ListBoxItem item)

Parameters

item ListBoxItem

The ListBoxItem to remove.

RemoveAt(int)

Removes the ListBoxItem at the specified index.

public void RemoveAt(int index)

Parameters

index int

The zero-based index of the ListBoxItem to remove.