다음을 통해 공유


How to create a new app project from a template for Windows Phone 8

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

To create a new app for Windows Phone, you start by creating a new project in Visual Studio or in Blend for Visual Studio. When you create a new project, you also make the following selections:

  1. Your preferred programming language - Visual C#, Visual Basic, or Visual C++.

  2. A project template for the new project.

  3. A location in the file system for the new project.

  4. The target version of the Windows Phone operating system – Windows Phone 8 or Windows Phone OS 7.1.

After you make these selections, Visual Studio or Blend creates and configures all the necessary files. Then it opens the file where you typically start coding or designing your app.

For more info about working with Blend, see Blend for Visual Studio.

This topic contains the following sections.

 

Creating a new project from a template

To create a new app from a project template in Visual Studio 

  1. In Visual Studio, on the File menu, click New Project.

    The New Project dialog box opens.

  2. In the Installed Templates list, select your preferred programming language - Visual C#, Visual Basic, or Visual C++. Then select the Windows Phone category.

    You will see the list of project templates for developing Windows Phone apps in the specified language. For example, the following screen shot shows the Windows Phone project templates in C#. The screen shot includes the following numbered areas:

    • (1) List of installed templates.

    • (2) Windows Phone project templates that use the C# language.

    • (3) Short description of the selected template.

    • (4) Screen shot of the default page created by the selected template.

  3. Select a template from the list of available project templates.

  4. At the bottom of the dialog box, choose a name and a file system location for the project. Then click OK.

    The Windows Phone platform selection dialog box appears.

    When you create a project using one of the new templates added in Windows Phone SDK 8.0, this dialog box does not appear. These projects always target Windows Phone 8.

  5. In the Windows Phone platform selection dialog box, select the Windows Phone platform that you want to target with your app - Windows Phone 8 or Windows Phone OS 7.1. Then click OK.

    A new project is created and the main page opens.

C# and Visual Basic project templates

The following project templates are available for projects written in Visual C# or Visual Basic.

Windows Phone project templates

The following project templates are available for Windows Phone projects written in Visual C# or Visual Basic.

Project template

Description

Windows Phone App

A project for creating a Windows Phone application.

This template creates a simple one-page project that can be used as a starting point for any app.

Windows Phone Databound App

A project for creating a Windows Phone application that uses list and navigation controls with a basic Model-View-ViewModel architecture.

For more information about the Model-View-ViewModel design pattern, see Implementing the Model-View-ViewModel pattern for Windows Phone 8.

Windows Phone Class Library

A project for creating a Windows Phone class library.

This template creates a project that has no user interface elements. You can use this class library in other Windows Phone apps.

Windows Phone Panorama App

A project for creating a Windows Phone application that uses the Panorama control.

The Panorama control is a long horizontal canvas that extends beyond a single screen. For more information, see Panorama control for Windows Phone 8.

Windows Phone Pivot App

A project for creating a Windows Phone application that uses the Pivot control.

The Pivot control lets you switch between views or pages within the app. For more information, see Pivot control for Windows Phone 8.

Windows Phone XAML and Direct3D App

A project for creating a Windows Phone managed application with native components.

This project type is new in Windows Phone SDK 8.0.

Windows Phone XAML and XNA App

A project for creating a Windows Phone XAML application that’s capable of rendering graphics using the XNA Framework.

This project template is available only for projects that target Windows Phone OS 7.1. You cannot create projects that target Windows Phone OS 8.0 for this project type.

Windows Phone HTML5 App

A project for creating a Windows Phone application that uses primarily HTML content.

Windows Phone Audio Playback Agent

A class library project for creating a background agent to play audio.

You can use this class library in other Windows Phone apps. For more information about using an audio playback agent, see How to play background audio for Windows Phone 8 and Background audio overview for Windows Phone 8.

Windows Phone Audio Streaming Agent

A class library project for creating a background agent to stream audio.

You can use this class library in other Windows Phone apps.

Windows Phone Scheduled Task Agent

A class library project for creating a background agent to perform a periodic or resource-intensive task.

You can use this class library in other Windows Phone apps. For more information about how to use scheduled tasks, see How to implement background agents for Windows Phone 8.

XNA Game Studio 4.0 project templates

The following project templates are available for XNA Game Studio 4.0 projects written in Visual C# or Visual Basic.

These project templates are available only for projects that target Windows Phone OS 7.1. You cannot create projects that target Windows Phone 8 for these project types.

Project template

Description

Windows Phone Game (4.0)

A project for creating an XNA Framework 4.0 Windows Phone game.

Windows Phone Game Library (4.0)

A project for creating an XNA Framework 4.0 Windows Phone game library.

Content Pipeline Extension Library (4.0)

A project for creating an XNA Framework 4.0 Content Pipeline extension library.

Empty Content Project (4.0)

A project for creating an XNA Framework 4.0 content project.

C++ project templates

The following project templates are available for Windows Phone projects written in Visual C++.

These project types and templates are new in Windows Phone SDK 8.0.

Project template

Description

Windows Phone Direct3D with XAML App

A project for creating a Windows Phone application that uses Direct3D and XAML.

Windows Phone Direct3D App (Native Only)

A project for creating a Windows Phone app that uses Direct3D.

Windows Phone Runtime Component

A project for creating a Windows Phone Runtime component for a Windows Phone app.

Windows Phone Empty Dynamic Link Library

A project for creating a native dynamic-link library for a Windows Phone app.

Windows Phone Empty Static Library

A project for creating a native static library for a Windows Phone app.

Creating your own custom project templates

You can also create your own custom project templates. For more information, see Creating Project and Item Templates.

See Also

Other Resources

Visual Studio Express 2012 for Windows Phone 8