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
SystemObject
  SystemAttribute
    System.ComponentModel.CompositionExportAttribute
      TomsToolbox.Wpf.Composition.MefDataTemplateAttribute

Namespace: TomsToolbox.Wpf.Composition.Mef
Assembly: TomsToolbox.Wpf.Composition.Mef (in TomsToolbox.Wpf.Composition.Mef.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
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 propertyDataType Gets the type of the view model that this visual has a representation for.
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.
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