Export (0) Print
Expand All

Accessing Custom Item Templates

Visual Studio item templates represent items that a user can add to a project using the Add New Item dialog box. Custom items represented by a item templates can be made available to XNA Game Studio Express projects with a few modifications to the item template.
Bb203936.note(en-US,XNAGameStudio.10).gifNote
Detailed documentation of Visual Studio item templates can be found in the Visual Studio 2005 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 Express filters the item template list based on the contents of this file. Valid item templates must be marked as XNA-compatible by including the TemplateGroupID element in the .vstemplate file.

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

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

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

      . . .
      <TemplateData>
      <Name>MyX360Class</Name>
      <Description>My custom Xbox 360 C# class.</Description>
      <ProjectType>CSharp</ProjectType>
      <TemplateGroupID>XnaFramework-v1-Xbox360</TemplateGroupID>
      <ShowByDefault>false</ShowByDefault>
      . . .
      </TemplateData>
      . . .
    
Show:
© 2014 Microsoft