Monday, 29 October 2012

Project templates for Windows Store apps


This topic describes the project templates for Windows Store apps built for Windows using Visual C#.

Grid project template for Windows Store apps : 

The Grid App template is a great way to start a Windows Store app that you can customize to enable users to browse through categories to find content in which they'll want to fully immerse themselves. Examples include shopping apps, news apps, and photo or video apps. 

The Grid app starts with a home page that shows a list of groups. A group is a named set of items, such as a part of a virtual department store that contains individual retail items. If the user selects a group, the app opens the group details page, which displays a list of the items on the right side. The user can select an item on either the home page or the group details page. This opens a full-page view that shows the item details (shown here on top).





The Grid App template includes these .xaml files : 

  • App.xaml, which is loaded first and provides markup for the content host (where each page is loaded into the main window).
  • GroupedItemsPage.xaml, which is the home page. It enables a user to view the groups and items, and either select an item to navigate to the full-page item view, or a select a group label to navigate to the group details page..
  • GroupDetailPage.xaml, which enables a user to view group details on the left and items on the right, and select an item to navigate to the full-page item view.
  • ItemDetailPage.xaml, which is the full-page view for an item. 
The template includes these .cs|.vb|.cpp|.h files:
  • App.xaml.cs|.vb|.cpp|.h, which specifies how the app behaves when it's started.
  • GroupedItemsPage.xaml.cs|.vb|.cpp|.h, which specifies behavior that's associated with the home page.
  • GroupDetailPage.xaml.cs|.vb|.cpp|.h, which specifies behavior that's associated with the group details page.
  • ItemDetailPage.xaml.cs|.vb|.cpp|.h, which specifies behavior that's associated with the full-page item view.
  • SampleDataSource.cs|.vb|.cpp|.h, which is the data-source object that exposes the data to the app.
The Grid App template also includes the package.appxmanifest file, which describes the app package for Windows, and a .pfx file that's used to sign the .appxmanifest file. (This file is included as a project file to support building from the command line.) The template also includes several image files, like splashscreen.png for the splash screen image, and storelogo.png, which is used for Windows Store.

Split project template for Windows Store apps :

The Split App template is a great way to start creating a Windows Store app that you can customize to enable users to view a list of items and item details in a two-column view, where users might want to switch quickly among the items, and where the list might be updated dynamically. Examples include a news reader, a sports scores app, or an email app. 

The Split app starts with a home page that shows a list of groups. A group is a named set of items, like a news source that provides news stories. When the user selects a group by tapping or clicking it, the app opens the split-view page. The Split app pages are shown here:  


The split-view page displays a two-column view (or master/detail view), where the details on the right side change when a user selects an item on the left side. Again, imagine a list of news stories on the left side and the actual stories on the right side.

The Split App template includes these .xaml files: 
  • App.xaml, which is loaded first and provides markup for the content host (where each page is loaded into the main window).
  • ItemsPage.xaml, which is the home page. It enables a user to select a group to navigate to the app's split-view page.
  • SplitPage.xaml, which is the split-view page. It defines two sections—one for the list of items on the left and another for the item details on the right.
 The template includes these .cs|.vb|.cpp|.h files:
  • App.xaml.cs|.vb|.cpp|.h, which specifies how the app behaves when it's started.
  • ItemsPage.xaml.cs|.vb|.cpp|.h, which specifies behavior that's associated with the home page.
  • SplitPage.xaml.cs|.vb|.cpp|.h, which specifies behavior that's associated with the split-view page.
  • SampleDataSource.cs|.vb|.cpp|.h, which is the data-source object that exposes data to the app.
The Split App template also includes the package.appxmanifest file, which describes the app package for Windows, and a .pfx file that's used to sign the appxmanifest file. (This file is included as a project file to support building from the command line.) The template also includes several image files, like splashscreen.png for the splash screen image, and storelogo.png, which is used for Windows Store.

What comes with a template?

When you open a project template, a folder labeled "Common" appears in Solution Explorer. This folder contains a few classes and resources that your project, and any item templates that you add, rely on. Because of this dependency, you shouldn't modify the contents of this folder, but you can (and often should) override some of these styles and methods elsewhere in your app to make them work the way you want them to. This illustration shows the default contents of Solution Explorer when you create a Visual C# Grid App project:

 

No comments:

Post a Comment