Class ItemsControl
Represents a control that can be used to present a collection of items.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class ItemsControl : Control
Constructors
| Improve this Doc View SourceItemsControl()
Initializes a new instance of the ItemsControl class.
Declaration
public ItemsControl()
Fields
| Improve this Doc View SourceDisplayMemberPathProperty
Identifies the DisplayMemberPath dependency property.
Declaration
public static readonly DependencyProperty DisplayMemberPathProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemContainerStyleProperty
Identifies the ItemContainerStyle dependency property.
Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemsPanelProperty
Identifies the ItemsPanel dependency property.
Declaration
public static readonly DependencyProperty ItemsPanelProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemTemplateProperty
Identifies the ItemTemplate dependency property.
Declaration
public static readonly DependencyProperty ItemTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceDisplayMemberPath
Gets or sets a path to a value on the source object to serve as the visual representation of the object.
Declaration
public string DisplayMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ItemContainerGenerator
Gets the ItemContainerGenerator associated with this ItemsControl.
Declaration
public ItemContainerGenerator ItemContainerGenerator { get; }
Property Value
Type | Description |
---|---|
ItemContainerGenerator |
ItemContainerStyle
Gets or sets the style that is used when rendering the item containers.
Declaration
public Style ItemContainerStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
Items
Items is the collection of data that is used to generate the content of this control.
Declaration
public ItemCollection Items { get; }
Property Value
Type | Description |
---|---|
ItemCollection |
ItemsPanel
Gets or sets the template that defines the panel that controls the layout of items.
Declaration
public ItemsPanelTemplate ItemsPanel { get; set; }
Property Value
Type | Description |
---|---|
ItemsPanelTemplate |
ItemsSource
Gets or sets an object source used to generate the content of the ItemsControl.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerable |
ItemTemplate
Gets or sets the DataTemplate used to display each item.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
Methods
| Improve this Doc View SourceClearContainerForItemOverride(DependencyObject, Object)
Undoes the effects of the PrepareContainerForItemOverride method.
Declaration
protected virtual void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The container element. |
System.Object | item | The item. |
GetContainerForItemOverride()
Creates or identifies the element that is used to display the given item.
Declaration
protected virtual DependencyObject GetContainerForItemOverride()
Returns
Type | Description |
---|---|
DependencyObject | The element that is used to display the given item. |
GetItemsOwner(DependencyObject)
Declaration
public static ItemsControl GetItemsOwner(DependencyObject element)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element |
Returns
Type | Description |
---|---|
ItemsControl |
INTERNAL_OnAttachedToVisualTree()
Declaration
protected override void INTERNAL_OnAttachedToVisualTree()
Overrides
| Improve this Doc View SourceIsItemItsOwnContainerOverride(Object)
Determines whether the specified item is (or is eligible to be) its own container.
Declaration
protected virtual bool IsItemItsOwnContainerOverride(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The item to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item is (or is eligible to be) its own container; otherwise, false. |
ItemsControlFromItemContainer(DependencyObject)
Declaration
public static ItemsControl ItemsControlFromItemContainer(DependencyObject container)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | container |
Returns
Type | Description |
---|---|
ItemsControl |
ManageCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected virtual void ManageCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Called when the value of the Items property changes.
Declaration
protected virtual void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | A System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains the event data |
OnItemsSourceChanged(IEnumerable, IEnumerable)
Declaration
protected virtual void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable | oldValue | |
System.Collections.IEnumerable | newValue |
OnItemsSourceChanged_BeforeVisualUpdate(IEnumerable, IEnumerable)
Declaration
protected virtual void OnItemsSourceChanged_BeforeVisualUpdate(IEnumerable oldValue, IEnumerable newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable | oldValue | |
System.Collections.IEnumerable | newValue |
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected virtual void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The element that's used to display the specified item. |
System.Object | item | The item to display. |
UpdateItemsPanel(ItemsPanelTemplate)
Declaration
protected virtual void UpdateItemsPanel(ItemsPanelTemplate newTemplate)
Parameters
Type | Name | Description |
---|---|---|
ItemsPanelTemplate | newTemplate |