Customizing Projects for Use with AppFactory

This page covers how to customize existing projects so they can be built with AppFactory. Before proceeding you should at least have an understanding of the AppFactory build Process.

Leveraging the Sample

Since there are several folders involved in the build process, and since the included sample project is a good starting point for any project, we recommended starting from a copy of the Sample folder included with AppFactory. This page assumes you are working with a copy of the Sample folder or at least the same structure.

Special Folders

  • Template - The folder where the custom project should be placed. Don't forget to delete all of the sample files from this folder before copying in the new files.
  • Assets - Contains any application-specific files (images, sounds, etc.). For more information see Application Assets.
  • Tasks - Contains the Custom Task assemblies used by the project (already included in the Sample folder).
  • Output - The folder where xap files will be placed as the applications are built.
  • Working - The temporary workspace folder that is deleted and recreated on every build.

AFProj and Data

As mentioned above, it's a good idea to start with the included Sample.afproj and Sample.accdb files. The .afproj file is the build script and is documented on the AFProj File page. The .accdb file is the database that contains Application Data.

It's a good idea to rename both the .afproj file and the .accdb file to match your project. If the .accdb file is renamed, don't forget to edit the .afproj file and update the <AppDbFile> property to point at the new database.

Finally, update the <TemplateProject> property inside the .afproj file to point at the correct .csproj or .sln file for your project.

Updating Your Template Project

Thanks to the "search and replace" capabilities of the Detokenize task, most of the work involved in making a project work with AppFactory is simply placing tokens in key files. Below is a listing of the most common files to modify and the tokens to use:

WMAppManifest.xml

  1. In the <App element set ProductID="{$(Application.ProductID)}" (leave the { and } curly braces intact)
  2. In the <App element set Title="$(Application.Title)"
  3. In the <App element set Version="$(Application.Version)"
  4. In the <App><Tokens><PrimaryToken> element set <Title>$(Application.Title)</Title>

App.xaml

Create a resource for the application title:

<Application.Resources>
   <System:String x:Key="AppTitle">$(Application.Title)</System:String>
</Application.Resources>


All Screens (MainPage.xaml, etc)

Any screen that displays the application title should be updated to use the new resource.

Select the TextBlock that displays the application title.
AppTitlePage.png

In the Properties window, click on the Advanced options button next to the Text property.
AdvancedOptions.png

Click on Local Resource -> AppTitle
SelectResource.png

Last edited Mar 6, 2012 at 8:19 PM by jaredbienz, version 2

Comments

No comments yet.