In This Article

BarGalleryItemTemplateSelector Class

Provides a DataTemplateSelector that selects item templates for various gallery item view models, generally used with a BarGalleryBase-based control and assigned to its ItemTemplateSelector property.

public class BarGalleryItemTemplateSelector : DataTemplateSelector
Inheritance:
object DataTemplateSelector object

Constructors

BarGalleryItemTemplateSelector()

Initializes an instance of the class.

public BarGalleryItemTemplateSelector()

Properties

ColorMenuItemTemplate

The DataTemplate to use for a ColorBarGalleryItemViewModel using a menu item appearance.

public DataTemplate? ColorMenuItemTemplate { get; set; }

Property Value

DataTemplate

ColorTemplate

public DataTemplate? ColorTemplate { get; set; }

Property Value

DataTemplate

DefaultTemplate

public DataTemplate? DefaultTemplate { get; set; }

Property Value

DataTemplate

FontFamilyTemplate

public DataTemplate? FontFamilyTemplate { get; set; }

Property Value

DataTemplate

FontSizeTemplate

public DataTemplate? FontSizeTemplate { get; set; }

Property Value

DataTemplate

MenuItemTemplate

The DataTemplate to use for an IBarGalleryItemViewModel using a menu item appearance.

public DataTemplate? MenuItemTemplate { get; set; }

Property Value

DataTemplate

SizeSelectionTemplate

The DataTemplate to use for a System.Windows.Size.

public DataTemplate? SizeSelectionTemplate { get; set; }

Property Value

DataTemplate

SymbolDataTemplate

public DataTemplate? SymbolDataTemplate { get; set; }

Property Value

DataTemplate

TextStyleTemplate

public DataTemplate? TextStyleTemplate { get; set; }

Property Value

DataTemplate

Methods

PrefersMenuItemAppearance(object, DependencyObject)

Returns whether the item should prefer menu item appearance, which is only when within a BarMenuGallery, and either UseMenuItemAppearance is set or the item requests it via LayoutBehavior.

protected virtual bool PrefersMenuItemAppearance(object item, DependencyObject container)
Parameter Type Description
item object

The item to examine.

container DependencyObject

The container control.

Returns

bool:

true if the item should prefer menu item appearance; otherwise, false.

SelectTemplate(object, DependencyObject)

When overridden in a derived class, returns a DataTemplate based on custom logic.

public override DataTemplate? SelectTemplate(object item, DependencyObject container)
Parameter Type Description
item object

The data object for which to select the template.

container DependencyObject

The data-bound object.

Returns

DataTemplate:

Returns a DataTemplate or null. The default value is null.

Inherited Members

Extension Methods