C# • Construct a Document

Listing 4. The changes you make to the project file to build a document instead of an application are minor: Set the value of the TargetType property to Document, import the WindowsDocument.target project for the appropriate build rules, and include all other project files as usual.

<Project DefaultTargets="Build">
   <PropertyGroup>
      <Property TargetType="Document" />
      <Property Language="C#" />
         <Property DefaultClrNameSpace=
            "IntroLonghorn" />
         <Property TargetName="MyDocument" />
   </PropertyGroup>

   <Import Project=
      "$(LAPI)\WindowsDocument.target" />

   <ItemGroup>
      <Item Type=
         "ApplicationDefinition" 
         Include="MyApp.xaml" />

      <Item Type="Pages" Include="Markup.xaml" />
      <Item Type="Pages" Include=
         "Navigate.xaml" />
      <Item Type="Code" 
         Include="Navigate.xaml.cs"/>

      <Item Type="Resources" 
         Include="Picture1.jpg"
         FileStorage="embedded" 
            Localizable="False"/>
      <Item Type="Resources" 
         Include="Picture2.jpg"
         FileStorage="embedded" 
            Localizable="True"/>
   </ItemGroup>
</Project>