In This Article

TreeNodeItemCollection Class

Stores a collection of tree node items.

public class TreeNodeItemCollection : ISelectedTreeItemCollection
Inheritance:
object object
Implements:
ISelectedTreeItemCollection

Constructors

TreeNodeItemCollection(bool)

Initializes an instance of the class.

public TreeNodeItemCollection(bool useHashSet)
Parameter Type Description
useHashSet bool

Whether to use a hash set to handle ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNodeItemCollection.Contains(ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode) checks faster. Only use for selection collections.

Properties

CanFilter

Gets a value that indicates whether this view supports filtering via the System.ComponentModel.ICollectionView.Filter property.

public bool CanFilter { get; }

Property Value

bool:

true if this view support filtering; otherwise, false.

CanGroup

Gets a value that indicates whether this view supports grouping via the System.ComponentModel.ICollectionView.GroupDescriptions property.

public bool CanGroup { get; }

Property Value

bool:

true if this view supports grouping; otherwise, false.

CanSort

Gets a value that indicates whether this view supports sorting via the System.ComponentModel.ICollectionView.SortDescriptions property.

public bool CanSort { get; }

Property Value

bool:

true if this view supports sorting; otherwise, false.

Count

Gets the number of elements contained in the ICollection<T>.

public int Count { get; }

Property Value

int:

The number of elements contained in the ICollection<T>.

Culture

Gets or sets the cultural info for any operations of the view that may differ by culture, such as sorting.

public CultureInfo Culture { get; set; }

Property Value

CultureInfo:

The culture to use during sorting.

CurrentItem

Gets the current item in the view.

public object? CurrentItem { get; }

Property Value

object:

The current item of the view or null if there is no current item.

CurrentPosition

Gets the ordinal position of the System.ComponentModel.ICollectionView.CurrentItem within the view.

public int CurrentPosition { get; }

Property Value

int:

The ordinal position of the System.ComponentModel.ICollectionView.CurrentItem within the view.

Filter

Gets or sets a callback used to determine if an item is suitable for inclusion in the view.

public Predicate<object>? Filter { get; set; }

Property Value

Predicate<object>:

A method used to determine if an item is suitable for inclusion in the view.

GroupDescriptions

Gets a collection of System.ComponentModel.GroupDescription objects that describe how the items in the collection are grouped in the view.

public ObservableCollection<GroupDescription> GroupDescriptions { get; }

Property Value

ObservableCollection<GroupDescription>:

A collection of System.ComponentModel.GroupDescription objects that describe how the items in the collection are grouped in the view.

Groups

Gets the top-level groups.

public ReadOnlyObservableCollection<object>? Groups { get; }

Property Value

ReadOnlyObservableCollection<object>:

A read-only collection of the top-level groups or null if there are no groups.

IsCurrentAfterLast

Gets a value that indicates whether the System.ComponentModel.ICollectionView.CurrentItem of the view is beyond the end of the collection.

public bool IsCurrentAfterLast { get; }

Property Value

bool:

true if the System.ComponentModel.ICollectionView.CurrentItem of the view is beyond the end of the collection; otherwise, false.

IsCurrentBeforeFirst

Gets a value that indicates whether the System.ComponentModel.ICollectionView.CurrentItem of the view is beyond the beginning of the collection.

public bool IsCurrentBeforeFirst { get; }

Property Value

bool:

true if the System.ComponentModel.ICollectionView.CurrentItem of the view is beyond the beginning of the collection; otherwise, false.

IsEmpty

Returns a value that indicates whether the resulting view is empty.

public bool IsEmpty { get; }

Property Value

bool:

true if the resulting view is empty; otherwise, false.

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

public bool IsReadOnly { get; }

Property Value

bool:

true if the ICollection<T> is read-only; otherwise, false.

this[int]

Returns the item at the specified index.

public object this[int index] { get; }
Parameter Type Description
index int

The index of the item to return.

Property Value

object

SortDescriptions

Gets a collection of System.ComponentModel.SortDescription objects that describe how the items in the collection are sorted in the view.

public SortDescriptionCollection SortDescriptions { get; }

Property Value

SortDescriptionCollection:

A collection of System.ComponentModel.SortDescription objects that describe how the items in the collection are sorted in the view.

SourceCollection

Returns the underlying collection.

public IEnumerable SourceCollection { get; }

Property Value

IEnumerable:

An IEnumerable object that is the underlying collection.

Methods

Contains(object)

Determines whether the ICollection<T> contains a specific value.

public bool Contains(object item)
Parameter Type Description
item object

The object to locate in the ICollection<T>.

Returns

bool:

true if item is found in the ICollection<T>; otherwise, false.

CopyTo(object[], int)

Copies the entire List<T> to a compatible one-dimensional array, starting at the specified index of the target array.

public void CopyTo(object[] array, int arrayIndex)
Parameter Type Description
array object[]

The one-dimensional Array that is the destination of the elements copied from List<T>. The Array must have zero-based indexing.

arrayIndex int

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

Exceptions

Type Condition
ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

The number of elements in the source List<T> is greater than the available space from arrayIndex to the end of the destination array.

DeferRefresh()

Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.

public IDisposable DeferRefresh()

Returns

IDisposable:

An IDisposable object that you can use to dispose of the calling object.

GetEnumerator()

Returns an enumerator that iterates through a collection.

public IEnumerator<object> GetEnumerator()

Returns

IEnumerator<object>:

An IEnumerator object that can be used to iterate through the collection.

IndexOf(object)

Determines the index of a specific item in the IList<T>.

public int IndexOf(object item)
Parameter Type Description
item object

The object to locate in the IList<T>.

Returns

int:

The index of item if found in the list; otherwise, -1.

MoveCurrentTo(object?)

Sets the specified item to be the System.ComponentModel.ICollectionView.CurrentItem in the view.

public bool MoveCurrentTo(object? item)
Parameter Type Description
item object

The item to set as the System.ComponentModel.ICollectionView.CurrentItem.

Returns

bool:

true if the resulting System.ComponentModel.ICollectionView.CurrentItem is within the view; otherwise, false.

MoveCurrentToFirst()

Sets the specified item to be the System.ComponentModel.ICollectionView.CurrentItem in the view.

public bool MoveCurrentToFirst()

Returns

bool:

true if the resulting System.ComponentModel.ICollectionView.CurrentItem is within the view; otherwise, false.

MoveCurrentToLast()

Sets the last item in the view as the System.ComponentModel.ICollectionView.CurrentItem.

public bool MoveCurrentToLast()

Returns

bool:

true if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false.

MoveCurrentToNext()

Sets the item after the System.ComponentModel.ICollectionView.CurrentItem in the view as the System.ComponentModel.ICollectionView.CurrentItem.

public bool MoveCurrentToNext()

Returns

bool:

true if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false.

MoveCurrentToPosition(int)

Sets the item at the specified index to be the System.ComponentModel.ICollectionView.CurrentItem in the view.

public bool MoveCurrentToPosition(int position)
Parameter Type Description
position int

The index to set the System.ComponentModel.ICollectionView.CurrentItem to.

Returns

bool:

true if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false.

MoveCurrentToPrevious()

Sets the item before the System.ComponentModel.ICollectionView.CurrentItem in the view as the System.ComponentModel.ICollectionView.CurrentItem.

public bool MoveCurrentToPrevious()

Returns

bool:

true if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false.

Refresh()

Recreates the view.

public void Refresh()

Events

CollectionChanged

Occurs when the collection is changed.

public event NotifyCollectionChangedEventHandler? CollectionChanged

Event Type

NotifyCollectionChangedEventHandler

CurrentChanged

Occurs after the CurrentItem has changed.

public event EventHandler? CurrentChanged

Event Type

EventHandler

CurrentChanging

Occurs after the CurrentItem has changed.

public event CurrentChangingEventHandler? CurrentChanging

Event Type

CurrentChangingEventHandler

Inherited Members

Extension Methods