Create and test a WPF project
A Windows Presentation Foundation (WPF) project will build a Microsoft Windows application (.exe) that you can run on your Windows desktop. Microsoft Expression Blend 2 makes it easy to design the user interface for your application.
In Expression Blend, click New Project on the File menu.
The New Project dialog appears.
Under Select a project type, click WPF Application (.exe). 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 WPF project is created and the startup page, Window1.xaml, opens for editing.
Click the Project 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 a WPF 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.
Make sure the Design view is visible by clicking either the Design or Split tab on the side of the artboard. This will enable you to select items in the Toolbox to draw them on the artboard.
From the Toolbox, select the Rectangle tool.
Click and 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.
A new Rectangle object is added as a child object under the LayoutRoot object.
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 Toolbox 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 yellow bounding outline).
Click Save All on the File menu to save your project to disk. Save early, save often.
To build and run your application, click Test Solution 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.
You can design the user interface of your WPF application by adding more objects to the main document (typically Window1.xaml). For more information, see Add or modify an object, Draw a freeform path, Draw a curve, Add a text control to the artboard, Insert an image, audio, or video file into the active document, and Import 3D content.