Show / Hide Table of Contents

Class ItemsControl

Represents a control that can be used to present a collection of items.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Accordion
HeaderedItemsControl
MenuBase
Selector
Rating
TabControl
TreeView
Inherited Members
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.OnApplyTemplate()
Control.OnGotFocus(RoutedEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
Control.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
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.dll
Syntax
public class ItemsControl : Control, IControl, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

ItemsControl()

Initializes a new instance of the ItemsControl class.

Declaration
public ItemsControl()

Fields

| Improve this Doc View Source

DisplayMemberPathProperty

Identifies the DisplayMemberPath dependency property.

Declaration
public static readonly DependencyProperty DisplayMemberPathProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemContainerStyleProperty

Identifies the ItemContainerStyle dependency property.

Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemsPanelProperty

Identifies the ItemsPanel dependency property.

Declaration
public static readonly DependencyProperty ItemsPanelProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemsSourceProperty

Identifies the ItemsSource dependency property.

Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemTemplateProperty

Identifies the ItemTemplate dependency property.

Declaration
public static readonly DependencyProperty ItemTemplateProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

DisplayMemberPath

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
| Improve this Doc View Source

ItemContainerGenerator

Gets the ItemContainerGenerator associated with this ItemsControl.

Declaration
public ItemContainerGenerator ItemContainerGenerator { get; }
Property Value
Type Description
ItemContainerGenerator
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

ItemTemplate

Gets or sets the DataTemplate used to display each item.

Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type Description
DataTemplate
| Improve this Doc View Source

LogicalChildren

Gets an enumerator for the logical child objects of the ItemsControl object.

Declaration
protected override IEnumerator LogicalChildren { get; }
Property Value
Type Description
System.Collections.IEnumerator

An enumerator for the logical child objects of the ItemsControl object. The default is null.

Overrides
FrameworkElement.LogicalChildren

Methods

| Improve this Doc View Source

ClearContainerForItemOverride(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

GetItemsOwner(DependencyObject)

Declaration
public static ItemsControl GetItemsOwner(DependencyObject element)
Parameters
Type Name Description
DependencyObject element
Returns
Type Description
ItemsControl
| Improve this Doc View Source

IsItemItsOwnContainerOverride(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.

| Improve this Doc View Source

ItemsControlFromItemContainer(DependencyObject)

Declaration
public static ItemsControl ItemsControlFromItemContainer(DependencyObject container)
Parameters
Type Name Description
DependencyObject container
Returns
Type Description
ItemsControl
| Improve this Doc View Source

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

| Improve this Doc View Source

OnItemsSourceChanged(IEnumerable, IEnumerable)

Declaration
protected virtual void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
Type Name Description
System.Collections.IEnumerable oldValue
System.Collections.IEnumerable newValue
| Improve this Doc View Source

OnTextInput(TextCompositionEventArgs)

Declaration
protected override void OnTextInput(TextCompositionEventArgs e)
Parameters
Type Name Description
TextCompositionEventArgs e
Overrides
UIElement.OnTextInput(TextCompositionEventArgs)
| Improve this Doc View Source

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.

| Improve this Doc View Source

UpdateItemsPanel(ItemsPanelTemplate)

Declaration
protected virtual void UpdateItemsPanel(ItemsPanelTemplate newTemplate)
Parameters
Type Name Description
ItemsPanelTemplate newTemplate

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
ItemsControlExtensions.GetItemsHost(ItemsControl)
ItemsControlExtensions.GetScrollHost(ItemsControl)
ItemsControlExtensions.GetContainers(ItemsControl)
ItemsControlExtensions.GetContainers<TContainer>(ItemsControl)
ItemsControlExtensions.GetItemsAndContainers(ItemsControl)
ItemsControlExtensions.GetItemsAndContainers<TContainer>(ItemsControl)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source