Windows Dev Center

StyleSelector class

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

Inheritance

Object
  StyleSelector

Syntax


public class StyleSelector


See Remarks

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The StyleSelector class has these types of members:

Constructors

The StyleSelector class has these constructors.

ConstructorDescription
StyleSelector Initializes a new instance of the StyleSelector class.

 

Methods

The StyleSelector class has these methods. It also inherits methods from the Object class.

MethodDescription
SelectStyle Returns a specific Style based on custom logic.
SelectStyleCore When implemented by a derived class, returns a specific Style based on custom logic.

 

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.

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

Object
ItemContainerStyleSelector

 

 

Show:
© 2015 Microsoft