Working and testing your project in Expression Blend

Just as web documents are based on unique markup languages such as HTML, Expression Blend documents are also based on a unique markup language, Extensible Application Markup Language (XAML).


In Expression Blend you can create new XAML documents, open, save, and delete existing documents, and even copy and rename documents, just as you can in many other applications. Expression Blend also provides basic project recovery functionality and the ability to discard projects.

You can accomplish most document-related tasks by using the commands that are located on the File, Edit, and Project menus. You can even right-click documents in the Project panel and perform basic tasks quickly by using the shortcut menu. By default, Expression Blend creates a .csproj or .vbproj file for your WPF and Silverlight 2 projects, but also supports Microsoft Visual Studio solution files (.sln). For your Silverlight 1.0 projects, Expression Blend creates a website folder with no project or solution files.

To create a project, open Blend and in the welcome screen that appears click the New Project button, as shown in the Figure 1 below:

Figure1.jpg

Figure 1: showing how to create a project in expression blend

Or

To create a new WPF project

  1. On the File menu, click New Project.
     
  2. In the Create New Project dialog box, under Select a project type, click either WPF Application (.exe) or WPF Control Library.
     
  3. In the Name box, enter a name for the project.
     
  4. In the Location box, enter or browse to the folder where you want to store the project. By default, this is a folder named Blend Projects in your My Documents folder.

    See the figure below:

    Figure2.jpg

    Figure 2: showing how to create a project in expression blend using file menu

    TheLocation box is only available if the Save new projects to the Expression Blend Projects folder option is selected in the Project tab of the Options dialog box (Tools menu).
  5. In the Language menu, select a programming language (Visual C# or Visual Basic).

    Note: Ingeneral, you can bypass selecting a programming language and just use the default, which is C#. (Using C# creates .cs files.) However, there may be times when the developer who is working on your application may want to indicate a specific programming language-for example, Microsoft Visual Basic (which creates .vb files)-perhaps for ease of use, familiarity, or to integrate the project files more easily with legacy code.
     
  6. Click OK. Microsoft Expression Blend creates a new project and opens it for editing, depending on the following settings that are selected in the Project tabof the Options dialog box (Tools menu):

Save new projects to the Expression Blend Projects folder Thissetting automatically saves your new project to disk in the Expression Blend projects folder, or in the folder that you specified in the Location box of the Create New Project dialog box. Until a project is saved to disk, the project is in a temporary state, and there are some features (such as viewing events or browsing the project) that are unavailable.

Create a temporary project on startup This setting automatically creates a temporary empty project when you start Expression Blend. This temporary project will not be saved to disk, regardless of the previous setting.

Use a Grid panel as the default layout for new itemsThis setting uses a Grid element as the root layout element in your document. If you do not select this setting, a Canvas element is used asthe root layout element in your document.

The new project will look like this in the below figure:

Figure3.jpg

Test a project

Youcan verify whether your Microsoft Expression Blend project is working correctly by running it using the Test Project command.

To test a project

Makesure that the correct project is open in Expression Blend, and then click Test Solution on the Project menu, or simply press F5.

In the Results panel, review the test build process for any errors that mayhave occurred. If you encounter an error, a build of the project will be unsuccessful, and you will have to repair the error before you can successfully build the project. If the test build is successful, your project will automatically open in an application window.

Conclusion:

Hopethe article would have helped you in understanding working and testing your project in Expression Blend. I will be contributing more articles to make your Expression Blend learning easy and interesting.

Up Next
    Ebook Download
    View all
    Learn
    View all