Accessing Custom Item Templates

Describes how to access custom item templates. Visual Studio item templates represent items that a user can add to a project using the Add New Item dialog box. With a few modifications to the item template, you can make custom items represented by item templates available to XNA Game Studio projects.

You can find detailed documentation for Visual Studio item templates in the Visual Studio 2008 documentation set Creating Item Templates.

Item templates contain a .vstemplate file that provides an XML description of the template. XNA Game Studio filters the item template list based on the contents of this file. To make an item template properly compatible with XNA Game Studio projects, add the TemplateGroupID element to the .vstemplate file.

The possible values of TemplateGroupID may be:

XnaFramework-v4.0A general-purpose item template for an XNA Game Studio project.
XnaFramework-v4.0-ContentAn item to add to the Content Pipeline package. Added when you right-click Add in an XNA Game Studio content project.
XnaFramework-v4.0-Devices Specialized classes, new interfaces, or an item included at the code level for compilation. Added when you right-click Add in an XNA Game Studio code project.
For Windows projects, the ShowByDefault element will have a value of "false."

The following XML example defines the TemplateGroupID element in the .vstemplate file of an XNA Game Studio game-specific item template.

 ... <TemplateData>
         <Description>My custom XNA Game Studio class.</Description>
         <ShowByDefault>false</ShowByDefault> ... </TemplateData> ...

Community Additions