StyleSelector StyleSelector StyleSelector StyleSelector Class

Definition

Enables custom item style selection logic as a function of the content data and its specific item container.

public : class StyleSelector : IStyleSelector, IStyleSelectorOverrides
struct winrt::Windows::UI::Xaml::Controls::StyleSelector : IStyleSelector, IStyleSelectorOverrides
public class StyleSelector : IStyleSelector, IStyleSelectorOverrides
Public Class StyleSelector Implements IStyleSelector, IStyleSelectorOverrides
See Remarks
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The base StyleSelector class is not used as an object element in XAML. However, it is a common scenario to derive a custom StyleSelector, map a xmlns prefix for the custom class and its namespace/assembly, and then refer to an instance of the custom class as defined in a Resources block in XAML. This makes it possible to refer to the custom template selector class by x:Key, and use that reference to set the value of properties such as ItemContainerStyleSelector in XAML templates and particular visual states.

Constructors

StyleSelector() StyleSelector() StyleSelector() StyleSelector()

Initializes a new instance of the StyleSelector class.

Methods

SelectStyle(Object, DependencyObject) SelectStyle(Object, DependencyObject) SelectStyle(Object, DependencyObject) SelectStyle(Object, DependencyObject)

Returns a specific Style based on custom logic.

SelectStyleCore(Object, DependencyObject) SelectStyleCore(Object, DependencyObject) SelectStyleCore(Object, DependencyObject) SelectStyleCore(Object, DependencyObject)

When implemented by a derived class, returns a specific Style based on custom logic.

See Also