Create and test an application project

A Windows Presentation Foundation (WPF) project will build a Microsoft Windows application (.exe) that you can run on your Windows desktop. A Microsoft Silverlight project will build an application that you can run in a browser window. Microsoft Expression Blend makes it easy to design the user interface for your application.

To create and test an application project

  1. In Expression Blend, click New Project on the File menu.

    Cc296398.f60e8b59-50de-4da1-9ba8-722dc5394d9d(en-us,Expression.30).png

    The New Project dialog box appears.

  2. Under Project types, click WPF or Silverlight.

  3. In the list of available project templates, click one of the application project types: WPF Application, Silverlight 3 Application, Silverlight 3 Application + Website. The other fields display default values for the project name, location, programming language for the code-behind files, and the target version of the Microsoft .NET Framework. You can leave those fields as they are and click OK.

    A new application project is created and the startup page, either MainWindow.xaml or MainPage.xaml, opens for editing.

  4. Click the Projects panel to view the files that were created for your project.

    If you are a graphic designer who is working with a programmer to produce an application, both of you can work on the project at the same time. You would design the user interface by working with the markup files (.xaml), and the programmer would work with the code-behind files (.xaml.cs or .xaml.vb), possibly using Microsoft Visual Studio 2008.

  5. Make sure that Design view is visible by clicking either the Design Cc296398.32be2832-9f81-4617-97e6-a4a3988a136c(en-us,Expression.30).png or Split Cc296398.5b79e600-984e-4f44-b8cd-6c1522832ad4(en-us,Expression.30).png tab on the side of the artboard. This will enable you to select items in the Tools panel to draw them on the artboard.

    Cc296398.6077fdd4-d9ee-4372-9324-4e417771b3d6(en-us,Expression.30).png

  6. From the Tools panel, select Rectangle Cc296398.81ffc148-cf5c-4faf-bd3f-f38d3073a12c(en-us,Expression.30).png.

    Cc296398.8fbbbb21-be83-4cf6-903b-3a49f00c9860(en-us,Expression.30).png

    Drag your mouse on the artboard to draw a rectangle. If you want to constrain the aspect ratio in order to make a square, hold the SHIFT key while you drag.

    Cc296398.4da470fa-7261-468c-828a-6694f55af53b(en-us,Expression.30).png

    A new Rectangle object is added as a child object under the LayoutRoot object in the Objects and Timeline panel.

    The SHIFT and ALT keys modify most artboard actions when creating or modifying objects. SHIFT typically constrains the aspect ratio or rotation angle, and ALT typically maintains the center point. Selecting tools and controls from the Tools panel to draw them on the artboard is the most common way to add objects to your application. New objects are added as children of the active object (identified by a blue bounding outline).

  7. Click Save All on the File menu to save your project to disk. Save early, save often.

  8. To build and run your application, click Run Project on the Project menu (or press F5).

    If the test build is successful, your project will automatically open in an application window. If the test build is unsuccessful, you can view the build errors in the Results panel.

Next steps

See also

Tasks

Undo or redo an action

Add or link to an existing item

Change the active document

Insert an item into the active document

Insert an audio or video file into the active document