Поделиться через


ComboBox.SelectionBoxItemTemplate Свойство

Определение

Возвращает шаблон элемента содержимого поля выбора.

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

Значение свойства

Шаблон элемента.

Примеры

Следующий пример привязывает Content свойство свойства ContentPresenter к свойству SelectionBoxItemTemplate . ControlTemplate Часть ContentPresenter элемента для ComboBox.

Полный пример см. в разделе "Стиллинг" с примером ControlTemplates.

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

Комментарии

Использование атрибута XAML

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

Сведения о свойстве зависимостей

Элемент Ценность
Поле идентификатора SelectionBoxItemTemplateProperty
Свойства метаданных, равные свойству true Нет

Применяется к