text: Delphi WPF Application Template Library
  Have you heard about a new RAD Studio 2007 feature called "Template Libraries"? It is a new, very powerful Delphi IDE repository mechanism. It is no longer neccessary to write an Open Tools API package to add a custom project to RAD Studio 2007 "New Items" dialog. With "Template Libraries" the only thing you need to do is to create a special XML document with "bdstemplatelib" extension that describes a custom project and add it to the list of template libraries using "Template Libraries" dialog available from the "Tools->Template Libraries" menu option or from a context menu from within "New Items" dialog.
  In the RAD Studio Help system you can find more information about template libraries. For your (and my;-) convinience I have copied and pasted below "Template Libraries" RAD Studio 2007 help topic:
  Template LibrariesRAD.
  See Also:
  "Creating Template Libraries":
  - C++ Projects ("CBuilderProjectRepositoryCreator")
  - Delphi Projects ("DelphiProjectRepositoryCreator")
  - Delphi for .NET Projects ("DelphiDotNetProjectRepositoryCreator")
  - Delphi for ASP .NET Projects ("AspDelphiProjectRepositoryCreator")
  The Delphi for .NET compiler in RAD Studio 2007 supports .NET version 2.0. When Microsoft added support for WinFX technologies to .NET 2.0 they have decided to change .NET version number to 3.0 (probably to confuse everybody). So the bottom line is that Delphi for .NET 2007 currently supports .NET 2.0 and 3.0. During the Highlander (the codename for Delphi 2007) field test I’ve been looking into Delphi for .NET support for "Avalon" and "Indigo". These are codenames of respectively Windows Presentation Foundation (WPF) and Windows Communication Foundation (WCF) technologies. There is also another interesting .NET 3.0 technology called Windows Workflows, and I do not know what was a codename for a Windows Workflows.
  With Template Libraries in place it should be really easy to add a minimal "Delphi WPF Application" to RAD Studio 2007 "New Items" dialog!
  First I’m going to create a special folder called "template_libs" for my custom application template libraries under "RAD Studio" folder inside "My Documents". This seems to me as the most logical choice. The other two folders that already exists under "RAD Studio" are "Projects" where all new RAD Studio projects are stored by default and "code_templates" for custom RAD Studio Live Templates. Inside this folder I’m going to create a "WPFMinimal" subfolder for all files that make up a minimal Delphi for .NET Windows Presentation Foundation application.
  Note: If you are on Windows XP you need to make sure that you have .NET 3.0 installed on your machine. On Vista .NET 3.0 is installed by default.
  First we need to create a new Delphi for .NET Console Application.
  The second step is to add to the project references to .NET assemblies that contain types we are going to use in code. These assemblies are located in two different location in a default .NET 3.0 installation: "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0" and "C:\WINDOWS\Microsoft.NET\Framework\v3.0\WPF"
  At the minimum the WPF application needs to create an instance of "Application" class defined in the "System.Windows" namespace, and an instance of a class derived from a "Window" object. I have put a declaration of a "Window1" class derived from "Window" in a separate unit.
  If you click on "Run" then a console window will be displayed and an empty WPF form. This is an "improved start-from-scratchability" for Delphi for .NET WPF application. Now it is your turn to define what goes into the "Window1" class declaration. Probably a constructor and destructor would be handy. Maybe a dock panel… For a good WPF background I would recommend Charles Petzold’s "Applications = Code + Markup" excellent book.
  The last step is to create a *.bdstemplatelib file and add it to the IDE.
  Template Libraries that come with RAD Studio 2007 installation are located in the default installation inside "C:\Program Files\CodeGear\RAD Studio\5.0\ObjRepos\DelphiDotNet" folder, with one subfolder per each new custom application. For example "AjaxMinimal" subfolder contains all files that make up a minimal Delphi ASP.NET AJAX application, and directly above the "AjaxMinimal" folder there is a corresponding "AjaxMinimal.bdstemplatelib" XML file. I’m going to modify this template to create a "WPFMinimal" application template.
  <TemplateLibrary Version="1.0" id="WinFXminis">
  <Name>WinFX Application Templates</Name>
  <Description>Custom WinFX Application Templates</Description>
  <Items>
  <Item id="item1" Creator="DelphiDotNetProjectRepositoryCreator">
  <Name>WPF Application</Name>
  <Description>Delphi for .NET Minimal WPF Application</Description>
  <Author>CodeGear</Author>
  <Icon>gear.ico</Icon>
  <ProjectFile>WPFMinimal.dproj</ProjectFile>
  <DefaultProjectName>WPFApplication</DefaultProjectName>
  <FilePath>WPFMinimal</FilePath>
  </Item>
  </Items>
  </TemplateLibrary>
  Listing 1: WPFminimal.bdstemplatelib
  To install new template library just open "Template Libraries" dialog from "Tools" menu and add "WPFMinimal.bdstemplatelib" to the list of installed templates.
  If everything went fine you should be able to find a new item in "Delphi for .NET" project section in "New Items" dialog.
  Just double-click on "WPF Application" item and you should have a new "WPFApplication" Delphi for .NET project open in the IDE. Click on "Run" and you should see an empty WPF window.
  And what should I add to the "Window1" class?
  Download Delphi for .NET WPF RAD Studio 2007 Template Library from
  CodeGear Code Central or from
  here.
  Share This | Email this page to a friend
  That’s just so cool!
  Why didn’t you list it in your top 5?
  There is a problems: if the IDE is run without the Win32 personality (that is using the -pDelphiDotNet parameter) the template library projects do not show up.