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

Namespace:  TomsToolbox.Wpf.Composition
Assembly:  TomsToolbox.Wpf (in TomsToolbox.Wpf.dll) Version: 1.0.69.0
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.

[CanBeNull]

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.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
Remarks
Mainly used in conjunction with the RoleBasedDataTemplateSelector.
See Also