Click or drag to resize

RoleBasedDataTemplateKey Class

A resource key for data templates, like the DataTemplateKey, but adding a Role property to distinguish several data templates for different roles.
Inheritance Hierarchy
SystemObject
  System.Windows.MarkupMarkupExtension
    System.WindowsResourceKey
      System.WindowsTemplateKey
        TomsToolbox.Wpf.CompositionRoleBasedDataTemplateKey

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 RoleBasedDataTemplateKey : TemplateKey, 
	IEquatable<RoleBasedDataTemplateKey>

The RoleBasedDataTemplateKey type exposes the following members.

Constructors
 NameDescription
Public methodRoleBasedDataTemplateKey Initializes a new instance of the RoleBasedDataTemplateKey class.
Public methodRoleBasedDataTemplateKey(Object, Object) Initializes a new instance of the RoleBasedDataTemplateKey class.
Top
Properties
 NameDescription
Public propertyRole Gets or sets the role. The role is immutable and can be set only once.
Top
Methods
 NameDescription
Public methodEquals(Object) Determines whether the specified Object, is equal to this instance.
(Overrides TemplateKeyEquals(Object))
Public methodEquals(RoleBasedDataTemplateKey) Indicates whether the current object is equal to another object of the same type.
Public methodGetHashCode Returns a hash code for this instance.
(Overrides TemplateKeyGetHashCode)
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
Remarks
Mainly used in conjunction with the RoleBasedDataTemplateSelector.
See Also