Cette documentation est archivée et n’est pas conservée.

ItemsControl.ItemContainerStyleSelector, propriété

Enables you to provide custom style-selection logic for a style that can be applied to each generated container element. This is a dependency property.

Espace de noms: System.Windows.Controls
Assembly : PresentationFramework (dans presentationframework.dll)
Espace de noms XML :  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public StyleSelector ItemContainerStyleSelector { get; set; }
/** @property */
public StyleSelector get_ItemContainerStyleSelector ()

/** @property */
public void set_ItemContainerStyleSelector (StyleSelector value)

public function get ItemContainerStyleSelector () : StyleSelector

public function set ItemContainerStyleSelector (value : StyleSelector)

    <StyleSelector .../>

Valeur de la propriété

A StyleSelector object that contains logic that chooses the style to use as the ItemContainerStyle. The default value is référence Null (Nothing en Visual Basic).

Identifier field


Metadata properties set to true


You use the ItemContainerStyle property to set a style to affect the appearance of the elements that contain the data items. For example, for ListBox, the generated containers are ListBoxItem controls; for ComboBox, they are ComboBoxItem controls. If you have more than one style defined and need to supply logic to choose which one to apply, then you use the ItemContainerStyleSelector property instead of the ItemContainerStyle property. Note that this property is ignored if the ItemContainerStyle property is set.

The ItemsControl provides great flexibility for visual customization, and therefore, provides many styling and templating properties. To affect the layout of the items, you use the ItemsPanel property. If you are using grouping on your control, you can use GroupStyle or GroupStyleSelector. You use the ItemTemplate or the ItemTemplateSelector to specify the visualization of the data objects. For more information about when to specify an ItemTemplate, see Data Templating Overview.

Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.

.NET Framework

Prise en charge dans : 3.0