SelectionBoxItemTemplate Property

ComboBox.SelectionBoxItemTemplate Property

 

Gets the item template of the selection box content.

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

public DataTemplate SelectionBoxItemTemplate { get; private set; }

Property Value

Type: System.Windows.DataTemplate

An item template.

<object property="{TemplateBinding SelectionBoxItemTemplate}"/>

Identifier field

SelectionBoxItemTemplateProperty

Metadata properties set to true

None

The following example binds the Content property of a ContentPresenter to the SelectionBoxItemTemplate property. The ContentPresenter is part of the ControlTemplate for the ComboBox. For the complete sample, see Styling with ControlTemplates Sample.

<ContentPresenter x:Name="ContentSite"
                  IsHitTestVisible="False"
                  Content="{TemplateBinding SelectionBoxItem}"
                  ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                  ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                  Margin="3,3,23,3"
                  VerticalAlignment="Stretch"
                  HorizontalAlignment="Left">
</ContentPresenter>

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft