Class ItemsControlExtensions
Provides useful extensions to ItemsControl instances.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public static class ItemsControlExtensions
Methods
| Improve this Doc View SourceGetContainers(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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|