Språk

ComboBox.SelectionBoxItemTemplate Egenskap

Definition

Hämtar objektmallen för markeringsrutans innehåll.

public:
 property System::Windows::DataTemplate ^ SelectionBoxItemTemplate { System::Windows::DataTemplate ^ get(); };
public System.Windows.DataTemplate SelectionBoxItemTemplate { get; }
member this.SelectionBoxItemTemplate : System.Windows.DataTemplate
Public ReadOnly Property SelectionBoxItemTemplate As DataTemplate

Egenskapsvärde

En objektmall.

Exempel

I följande exempel binder Content egenskapen för en ContentPresenter till SelectionBoxItemTemplate egenskapen. ContentPresenter är en del av ControlTemplate för ComboBox.

Ett fullständigt exempel finns i Formatering med ControlTemplates-exempel.

<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>

Kommentarer

XAML-attributanvändning

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

Information om beroendeegenskap

Objekt Value
Identifierarfält SelectionBoxItemTemplateProperty
Metadataegenskaper inställda på true Ingen

Gäller för