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.
Bb203936.note(en-US,XNAGameStudio.30).gifNote
You can find detailed documentation of 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. For Xbox 360 projects, 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.

Values for the TemplateGroupID can be "XnaFramework-v2," "XnaFramework-v2-Xbox360," and "XnaFramework-v2-Windows."

  • XNA Game Studio Xbox 360 projects will show templates with a TemplateGroupID of "XnaFramework-v2" or "XnaFramework-v2-Xbox360."
  • XNA Game Studio Windows game projects will show templates with a TemplateGroupID of "XnaFramework-v2" or "XnaFramework-v2-Windows," and a ShowByDefault element with a value of "false."

The following XML example defines the TemplateGroupID element in the .vstemplate file of an Xbox 360 game-specific item template.

  ...
  <TemplateData>
  <Name>MyX360Class</Name>
  <Description>My custom Xbox 360 C# class.</Description>
  <ProjectType>CSharp</ProjectType>
  <TemplateGroupID>XnaFramework-v2-Xbox360</TemplateGroupID>
  <ShowByDefault>false</ShowByDefault>
  ...
  </TemplateData>
  ...          

Community Additions

ADD
Show: