System.Windows.Controls Nam ...


.NET Framework Class Library
ItemsPresenter Class

Used within the template of an item control to specify the place in the control’s visual tree where the ItemsPanel defined by the ItemsControl is to be added.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax

Visual Basic (Declaration)
<LocalizabilityAttribute(LocalizationCategory.NeverLocalize)> _
Public Class ItemsPresenter _
    Inherits FrameworkElement
Visual Basic (Usage)
Dim instance As ItemsPresenter
C#
[LocalizabilityAttribute(LocalizationCategory.NeverLocalize)]
public class ItemsPresenter : FrameworkElement
Visual C++
[LocalizabilityAttribute(LocalizationCategory::NeverLocalize)]
public ref class ItemsPresenter : public FrameworkElement
JScript
public class ItemsPresenter extends FrameworkElement
XAML Object Element Usage
<ItemsPresenter .../>
Examples

The following example shows how to use an ItemsPresenter in a control template for a HeaderedItemsControl.

XAML
<!--Define a control template for a HeaderedItemsControl-->
<Style TargetType="HeaderedItemsControl">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type HeaderedItemsControl}">
        <StackPanel>
          <Grid>
            <Rectangle Fill="{TemplateBinding Background}"/>
            <ContentPresenter ContentSource="Header"/>
          </Grid>
          <Grid>
            <Rectangle Stroke="{TemplateBinding BorderBrush}"/>
            <ItemsPresenter Margin="2,0,0,0"/>
          </Grid>
        </StackPanel>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
Inheritance Hierarchy

System..::.Object
  System.Windows.Threading..::.DispatcherObject
    System.Windows..::.DependencyObject
      System.Windows.Media..::.Visual
        System.Windows..::.UIElement
          System.Windows..::.FrameworkElement
            System.Windows.Controls..::.ItemsPresenter
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Tags :


Community Content

Thomas Lee
this info is useless.
Just a single line of description for an important class WPF!

Andy Lang
How two ItemsPresenters bind to the same source.
Like ComboBox, ListBox, how two ItemsPresenters bind to the same ItemsSource? I have try that but the display is not correct.

Tags :

Page view tracker