Click or drag to resize

DataTemplateAttribute Class

Attribute to apply to views to dynamically generate the DataTemplate that associates the view with it's view model.
Inheritance Hierarchy

Namespace:  TomsToolbox.Wpf.Composition
Assembly:  TomsToolbox.Wpf (in TomsToolbox.Wpf.dll) Version: 1.0.74.0
Syntax
[MetadataAttributeAttribute]
[AttributeUsageAttribute(AttributeTargets.Class)]
public sealed class DataTemplateAttribute : ExportAttribute, 
	IDataTemplateMetadata

The DataTemplateAttribute type exposes the following members.

Constructors
  NameDescription
Public methodDataTemplateAttribute
Initializes a new instance of the DataTemplateAttribute class.
Top
Properties
  NameDescription
Public propertyRole
Gets the role of this visual. If a role is set, a RoleBasedDataTemplateKey will be created for this view; else a simple DataTemplateKey is used.
Public propertyViewModel
Gets the type of the view model that this visual has a representation for.
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
See Also