Panel.IsItemsHost Property

Gets or sets a value that indicates that this Panel is a container for user interface (UI) items that are generated by an ItemsControl.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public bool IsItemsHost { get; set; }
/** @property */
public boolean get_IsItemsHost ()

/** @property */
public void set_IsItemsHost (boolean value)

public function get IsItemsHost () : boolean

public function set IsItemsHost (value : boolean)

<object IsItemsHost="bool" .../>

Property Value

true if this instance of Panel is an items host; otherwise, false. The default value is false.

Identifier field


Metadata properties set to true


You cannot databind to this property.

The following example demonstrates how to use the derived StackPanel element as an item's host.

  <Style TargetType="Separator">
    <Setter Property="Template">
        <ControlTemplate TargetType="{x:Type Separator}">
          <Border Width="2" Height="12" Margin="4" Background="Gray"/>

  <Style x:Key="ListBoxTemplate" TargetType="{x:Type ListBox}">
    <Setter Property="Template">
        <ControlTemplate TargetType="{x:Type ListBox}">
          <Border Background="{TemplateBinding Panel.Background}" 
                  BorderBrush="{TemplateBinding Border.BorderBrush}"
                  BorderThickness="{TemplateBinding Border.BorderThickness}">
            <ScrollViewer HorizontalScrollBarVisibility="Auto">
              <StackPanel x:Name="StackPanel1" IsItemsHost="True"

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions