Items​Presenter Items​Presenter Items​Presenter Class

Definition

Specifies where items are placed in a control, usually an ItemsControl.

public sealed class ItemsPresenter : FrameworkElement, IItemsPresenter, IItemsPresenter2, IScrollSnapPointsInfopublic sealed class ItemsPresenter : FrameworkElement, IItemsPresenter, IItemsPresenter2, IScrollSnapPointsInfoPublic NotInheritable Class ItemsPresenter Inherits FrameworkElement Implements IItemsPresenter, IItemsPresenter2, IScrollSnapPointsInfo
<ItemsPresenter .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited properties

Inherited events

Inherited methods

Constructors

ItemsPresenter() ItemsPresenter() ItemsPresenter()

Initializes a new instance of the ItemsPresenter class.

public ItemsPresenter()public ItemsPresenter()Public Sub New()
Attributes

Properties

AreHorizontalSnapPointsRegular AreHorizontalSnapPointsRegular AreHorizontalSnapPointsRegular

Gets a value that indicates whether the horizontal snap points for the ItemsPresenter are equidistant from each other.

public bool AreHorizontalSnapPointsRegular { get; }public bool AreHorizontalSnapPointsRegular { get; }Public ReadOnly Property AreHorizontalSnapPointsRegular As bool
Value
bool bool bool

True if the horizontal snap points for the ItemsPresenter are equidistant from each other; otherwise, false.

Attributes

AreVerticalSnapPointsRegular AreVerticalSnapPointsRegular AreVerticalSnapPointsRegular

Gets a value that indicates whether the vertical snap points for the ItemsPresenter are equidistant from each other.

public bool AreVerticalSnapPointsRegular { get; }public bool AreVerticalSnapPointsRegular { get; }Public ReadOnly Property AreVerticalSnapPointsRegular As bool
Value
bool bool bool

True if the vertical snap points for the ItemsPresenter are equidistant from each other; otherwise, false.

Attributes

Footer Footer Footer

Gets or sets the content for the items footer.

public object Footer { get; set; }public object Footer { get; set; }Public ReadWrite Property Footer As object
<ItemsPresenter Footer="footerString"/>

Value
object object object

The content of the items footer. The default is null.

Attributes

Remarks

You can set a data template for the Footer by using the FooterTemplate property.

FooterProperty FooterProperty FooterProperty

Identifies the Footer dependency property.

public static DependencyProperty FooterProperty { get; }public static DependencyProperty FooterProperty { get; }Public Static ReadOnly Property FooterProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Footer dependency property.

Attributes

FooterTemplate FooterTemplate FooterTemplate

Gets or sets the DataTemplate used to display the content of the items header.

public DataTemplate FooterTemplate { get; set; }public DataTemplate FooterTemplate { get; set; }Public ReadWrite Property FooterTemplate As DataTemplate
<ItemsPresenter>
  <ItemsPresenter.FooterTemplate>
    singleDataTemplate
  </ItemsPresenter.FooterTemplate>
</ItemsPresenter>
Value
DataTemplate DataTemplate DataTemplate

The template that specifies the visualization of the header object. The default is null.

Attributes

FooterTemplateProperty FooterTemplateProperty FooterTemplateProperty

Identifies the FooterTemplate dependency property.

public static DependencyProperty FooterTemplateProperty { get; }public static DependencyProperty FooterTemplateProperty { get; }Public Static ReadOnly Property FooterTemplateProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FooterTemplate dependency property.

Attributes

FooterTransitions FooterTransitions FooterTransitions

Gets or sets the collection of Transition style elements that apply to the footer of an ItemsPresenter.

public TransitionCollection FooterTransitions { get; set; }public TransitionCollection FooterTransitions { get; set; }Public ReadWrite Property FooterTransitions As TransitionCollection
<ItemsPresenter>
  <ItemsPresenter.FooterTransitions>
    <TransitionCollection>
      oneOrMoreTransitions
    </TransitionCollection>
  </ItemsPresenter.FooterTransitions>
</ItemsPresenter>
Value
TransitionCollection TransitionCollection TransitionCollection

The collection of Transition style elements that apply to the footer of an ItemsPresenter.

Attributes

Remarks

Important

The XAML syntax for all properties that use a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but properties that use TransitionCollection don't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.

Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or transition, the animation draws the attention of the user to the change.

FooterTransitionsProperty FooterTransitionsProperty FooterTransitionsProperty

Identifies the FooterTransitions dependency property.

public static DependencyProperty FooterTransitionsProperty { get; }public static DependencyProperty FooterTransitionsProperty { get; }Public Static ReadOnly Property FooterTransitionsProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FooterTransitions dependency property.

Attributes

Header Header Header

Gets or sets the content for the items header.

public object Header { get; set; }public object Header { get; set; }Public ReadWrite Property Header As object
<ItemsPresenter Header="headerString"/>

Value
object object object

The content of the items header. The default value is null.

Attributes

Remarks

You can set a data template for the Header by using the HeaderTemplate property.

Windows 8.1 Header alignment is handled differently in apps compiled for Windows 8 than in apps compiled for Windows 8.1.+ In an app compiled for Windows 8, the header is always left-aligned when the orientation of the items is Horizontal, or top-aligned when the orientation is Vertical. VerticalAlignment and HorizontalAlignment values that you set are ignored.

HeaderProperty HeaderProperty HeaderProperty

Identifies the Header dependency property.

public static DependencyProperty HeaderProperty { get; }public static DependencyProperty HeaderProperty { get; }Public Static ReadOnly Property HeaderProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Header dependency property.

Attributes

HeaderTemplate HeaderTemplate HeaderTemplate

Gets or sets the DataTemplate used to display the content of the items header.

public DataTemplate HeaderTemplate { get; set; }public DataTemplate HeaderTemplate { get; set; }Public ReadWrite Property HeaderTemplate As DataTemplate
<ItemsPresenter>
  <ItemsPresenter.HeaderTemplate>
    singleDataTemplate
  </ItemsPresenter.HeaderTemplate>
</ItemsPresenter>
Value
DataTemplate DataTemplate DataTemplate

The template that specifies the visualization of the header object. The default is null.

Attributes

Remarks

Windows 8.1 Header alignment is handled differently in apps compiled for Windows 8 than in apps compiled for Windows 8.1.+ In an app compiled for Windows 8, the header is always left-aligned when the orientation of the items is Horizontal, or top-aligned when the orientation is Vertical. VerticalAlignment and HorizontalAlignment values that you set are ignored.

HeaderTemplateProperty HeaderTemplateProperty HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

public static DependencyProperty HeaderTemplateProperty { get; }public static DependencyProperty HeaderTemplateProperty { get; }Public Static ReadOnly Property HeaderTemplateProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the HeaderTemplate dependency property.

Attributes

HeaderTransitions HeaderTransitions HeaderTransitions

Gets or sets the collection of Transition style elements that apply to the header of an ItemsPresenter.

public TransitionCollection HeaderTransitions { get; set; }public TransitionCollection HeaderTransitions { get; set; }Public ReadWrite Property HeaderTransitions As TransitionCollection
<ItemsPresenter>
  <ItemsPresenter.HeaderTransitions>
    <TransitionCollection>
      oneOrMoreTransitions
    </TransitionCollection>
  </ItemsPresenter.HeaderTransitions>
</ItemsPresenter>
Value
TransitionCollection TransitionCollection TransitionCollection

The collection of Transition style elements that apply to the header of an ItemsPresenter.

Attributes

Remarks

Important

The XAML syntax for all properties that use a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but properties that use TransitionCollection don't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.

Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or transition, the animation draws the attention of the user to the change.

HeaderTransitionsProperty HeaderTransitionsProperty HeaderTransitionsProperty

Identifies the HeaderTransitions dependency property.

public static DependencyProperty HeaderTransitionsProperty { get; }public static DependencyProperty HeaderTransitionsProperty { get; }Public Static ReadOnly Property HeaderTransitionsProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the HeaderTransitions dependency property.

Attributes

Padding Padding Padding

Gets or sets the distance between the ItemsPresenter and its child objects.

public Thickness Padding { get; set; }public Thickness Padding { get; set; }Public ReadWrite Property Padding As Thickness
Value
Thickness Thickness Thickness

The dimensions of the space between the presenter and its children as a Thickness value. Thickness is a structure that stores dimension values using pixel measures.

Attributes

Remarks

A Padding value applies to presentation rendering of each presented item and also to the header (if one is specified).

A related property is Margin (a property of FrameworkElement ). For ItemsPresenter , margin and padding would typically blend together with the division between them not being apparent in the rendering. So it's typical to specify a Margin or a Padding, but not both. For more info about the relationship between margin and padding, see Alignment, margin, and padding or Define layouts with XAML.

See Also

PaddingProperty PaddingProperty PaddingProperty

Identifies the Padding dependency property.

public static DependencyProperty PaddingProperty { get; }public static DependencyProperty PaddingProperty { get; }Public Static ReadOnly Property PaddingProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Padding dependency property.

Attributes

Methods

GetIrregularSnapPoints(Orientation, SnapPointsAlignment) GetIrregularSnapPoints(Orientation, SnapPointsAlignment) GetIrregularSnapPoints(Orientation, SnapPointsAlignment)

Returns a read-only collection of numbers that represent the snap points for the specified orientation.

public IVectorView<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment alignment)public IVectorView<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment alignment)Public Function GetIrregularSnapPoints(orientation As Orientation, alignment As SnapPointsAlignment) As IVectorView( Of float )
Parameters
orientation
Orientation Orientation Orientation

The orientation of the requested snap points.

alignment
SnapPointsAlignment SnapPointsAlignment SnapPointsAlignment

The alignment used by the caller when applying the requested snap points.

Returns

A read-only collection of numbers that represent the snap points for the specified orientation, or an empty collection when no snap points are present.

Attributes

GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single) GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single) GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single)

Returns an original offset and interval for equidistant snap points for the specified orientation.

public float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, Single offset)public float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, Single offset)Public Function GetRegularSnapPoints(orientation As Orientation, alignment As SnapPointsAlignment, offset As Single) As float
Parameters
orientation
Orientation Orientation Orientation

The orientation of the requested snap points.

alignment
SnapPointsAlignment SnapPointsAlignment SnapPointsAlignment

The alignment used by the caller when applying the requested snap points.

offset
System.Single System.Single System.Single

The offset of the first snap point.

Returns
float float float

The interval between equidistant snap points for the specified orientation or 0 when no snap points are present.

Attributes

Events

HorizontalSnapPointsChanged HorizontalSnapPointsChanged HorizontalSnapPointsChanged

Occurs when the horizontal snap points change.

public event EventHandler HorizontalSnapPointsChangedpublic event EventHandler HorizontalSnapPointsChangedPublic Event HorizontalSnapPointsChanged
<ItemsPresenter HorizontalSnapPointsChanged="eventhandler" />
Attributes

VerticalSnapPointsChanged VerticalSnapPointsChanged VerticalSnapPointsChanged

Occurs when the vertical snap points change.

public event EventHandler VerticalSnapPointsChangedpublic event EventHandler VerticalSnapPointsChangedPublic Event VerticalSnapPointsChanged
<ItemsPresenter VerticalSnapPointsChanged="eventhandler" />
Attributes