Show / Hide Table of Contents

Class ItemsControlExtensions

Provides useful extensions to ItemsControl instances.

Inheritance
System.Object
ItemsControlExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Toolkit.dll
Syntax
public static class ItemsControlExtensions

Methods

| Improve this Doc View Source

GetContainers(ItemsControl)

Get the item containers of an ItemsControl.

Declaration
public static IEnumerable<DependencyObject> GetContainers(this ItemsControl control)
Parameters
Type Name Description
ItemsControl control

The ItemsControl.

Returns
Type Description
System.Collections.Generic.IEnumerable<DependencyObject>

The item containers of an ItemsControl.

Exceptions
Type Condition
System.ArgumentNullException

control is null.

| Improve this Doc View Source

GetContainers<TContainer>(ItemsControl)

Get the item containers of an ItemsControl.

Declaration
public static IEnumerable<TContainer> GetContainers<TContainer>(this ItemsControl control)
    where TContainer : DependencyObject
Parameters
Type Name Description
ItemsControl control

The ItemsControl.

Returns
Type Description
System.Collections.Generic.IEnumerable<TContainer>

The item containers of an ItemsControl.

Type Parameters
Name Description
TContainer

The type of the item containers.

Exceptions
Type Condition
System.ArgumentNullException

control is null.

| Improve this Doc View Source

GetItemsAndContainers(ItemsControl)

Get the items and item containers of an ItemsControl.

Declaration
public static IEnumerable<KeyValuePair<object, DependencyObject>> GetItemsAndContainers(this ItemsControl control)
Parameters
Type Name Description
ItemsControl control

The ItemsControl.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, DependencyObject>>

The items and item containers of an ItemsControl.

Exceptions
Type Condition
System.ArgumentNullException

control is null.

| Improve this Doc View Source

GetItemsAndContainers<TContainer>(ItemsControl)

Get the items and item containers of an ItemsControl.

Declaration
public static IEnumerable<KeyValuePair<object, TContainer>> GetItemsAndContainers<TContainer>(this ItemsControl control)
    where TContainer : DependencyObject
Parameters
Type Name Description
ItemsControl control

The ItemsControl.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, TContainer>>

The items and item containers of an ItemsControl.

Type Parameters
Name Description
TContainer

The type of the item containers.

Exceptions
Type Condition
System.ArgumentNullException

control is null.

| Improve this Doc View Source

GetItemsHost(ItemsControl)

Gets the Panel that contains the containers of an ItemsControl.

Declaration
public static Panel GetItemsHost(this ItemsControl control)
Parameters
Type Name Description
ItemsControl control

The ItemsControl.

Returns
Type Description
Panel

The Panel that contains the containers of an ItemsControl, or null if the Panel could not be found.

Exceptions
Type Condition
System.ArgumentNullException

control is null.

| Improve this Doc View Source

GetScrollHost(ItemsControl)

Gets the ScrollViewer that contains the containers of an ItemsControl.

Declaration
public static ScrollViewer GetScrollHost(this ItemsControl control)
Parameters
Type Name Description
ItemsControl control

The ItemsControl.

Returns
Type Description
ScrollViewer

The ScrollViewer that contains the containers of an ItemsControl, or null if a ScrollViewer could not be found.

Exceptions
Type Condition
System.ArgumentNullException

control is null.

  • Improve this Doc
  • View Source