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.
ColorTemplate
The DataTemplate to use for a ColorBarGalleryItemViewModel.
DefaultTemplate
The DataTemplate to use for an IBarGalleryItemViewModel.
FontFamilyTemplate
The DataTemplate to use for a FontFamilyBarGalleryItemViewModel.
FontSizeTemplate
The DataTemplate to use for a FontSizeBarGalleryItemViewModel.
MenuItemTemplate
The DataTemplate to use for an IBarGalleryItemViewModel using a menu item appearance.
SizeSelectionTemplate
The DataTemplate to use for a System.Windows.Size.
SymbolDataTemplate
The DataTemplate to use for a SymbolBarGalleryItemViewModel.
TextStyleTemplate
The DataTemplate to use for a TextStyleBarGalleryItemViewModel.
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:
trueif 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 isnull.
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()