Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
ItemsControl Class
 Items Property
Other versions are also available for the following:
.NET Framework Class Library for Silverlight
ItemsControl..::.Items Property
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Gets or sets the collection used to generate the content of the ItemsControl.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

Visual Basic (Declaration)
Public ReadOnly Property Items As ItemCollection
Visual Basic (Usage)
Dim instance As ItemsControl
Dim value As ItemCollection

value = instance.Items
C#
public ItemCollection Items { get; }
Visual C++
public:
property ItemCollection^ Items {
    ItemCollection^ get ();
}
JScript
public function get Items () : ItemCollection
XAML Object Element Usage
<object>
  oneOrMoreFrameworkElements
</object>
XAML Values
oneOrMoreFrameworkElements

One or more object elements for classes that derive from FrameworkElement.

Property Value

Type: System.Windows.Controls..::.ItemCollection

The collection that is used to generate the content of the ItemsControl, if it exists; otherwise, nullNothingnullptra null reference (Nothing in Visual Basic). See Remarks. The default is an empty collection.

An ItemsControl reports its contents through one of two modes, which affects the values that are held by Items and ItemsSource.

  • Items returns an ItemCollection of objects if ItemsSource is null. In this case it is possible for the collection to be empty.

  • Items returns nullNothingnullptra null reference (Nothing in Visual Basic) if ItemsSource is non-null.

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker