Click or drag to resize

RoleBasedDataTemplateSelector Class

A template selector that finds the DataTemplate by the RoleBasedDataTemplateKey.
Inheritance Hierarchy
SystemObject
  System.Windows.ControlsDataTemplateSelector
    TomsToolbox.Wpf.CompositionRoleBasedDataTemplateSelector

Namespace: TomsToolbox.Wpf.Composition
Assembly: TomsToolbox.Wpf.Composition (in TomsToolbox.Wpf.Composition.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class RoleBasedDataTemplateSelector : DataTemplateSelector

The RoleBasedDataTemplateSelector type exposes the following members.

Constructors
 NameDescription
Public methodRoleBasedDataTemplateSelectorInitializes a new instance of the RoleBasedDataTemplateSelector class
Top
Properties
 NameDescription
Public propertyFallbackValue Gets or sets the template used as fallback if no template for the specified role is found.
Public propertyRole Gets or sets the role to use in the lookup.
Top
Methods
 NameDescription
Public methodSelectTemplate When overridden in a derived class, returns a DataTemplate based on custom logic.
(Overrides DataTemplateSelectorSelectTemplate(Object, DependencyObject))
Top
Extension Methods
 NameDescription
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions)
Top
See Also