Create an XAF Application

Use the Solution Wizard

XAF ships with the Solution Wizard allowing you to create a fully functional app in seconds. To do this, execute the following simple steps.

  1. From the Visual Studio main menu, select File | New | Project... to invoke the New Project dialog.
  2. In the Installed | Templates tree, expand the desired language (Visual C# or Other Languages | Visual Basic), and then choose DevExpress XAF. In the panel on the right, select DevExpress v18.2 XAF Solution Wizard, specify the new solution's name - "SimpleProjectManager", and click OK.

    SPM_NewProject

  3. This will invoke the Solution Wizard. In the first screen of the wizard, choose the target platform(s). You can create separate WinForms, ASP.NET, Mobile (beta) applications, or multiple applications at once. Choose the Windows and Web platforms and click Next.

    CTutor_Solution_Wizard_1

    Tip

    A separate tutorial is provided for mobile applications - XAF Mobile (Beta) Tutorial.

  4. In the next screen, choose both Entity Framework Code Fist and eXpress Persistent Objects using CTRL+click and then click Next.

    SolutionWizard_Step2_Both_Cut

    Note

    You can use Entity Framework (EF) or eXpress Persistent Objects (XPO) as your project's object-relational mapping (ORM) tool. In this tutorial, the EF Code First and XPO approaches are considered. Two ORMs are selected simultaneously for demo purposes. In real-world applications, a single ORM is typically used.

  5. In the next screen, you can choose the security options of your application. Choose None as the Authentication type. In this basic tutorial, the use of the XAF Security System is not considered.

    SolutionWizard_Step3_None_Cut

  6. Click Finish.

    Note

    On the next screen, you can choose the required XAF modules which will be automatically added to your application. However, in this basic tutorial this option is not required.

As a result, the following projects will be added to the solution.

SPM_SolutionExplorer

  • SimpleProjectManager.Module is a shared and platform-independent XAF module that contains only platform and UI agnostic code. An XAF module is technically a regular Class Library project allowing you to organize certain functionality (business model and logic, UI elements and behavior) so that it can be reused in an XAF application as a whole. Changes to this shared module will automatically be propagated to other modules that depend on it.
  • SimpleProjectManager.Module.Win is an XAF module that may contain the Windows Forms specific functionality and code. This module has SimpleProjectManager.Module in the dependencies.
  • SimpleProjectManager.Module.Web is a module that may contain the ASP.NET Web Forms specific functionality and code. This module has SimpleProjectManager.Module in the dependencies as well.
  • SimpleProjectManager.Win and SimpleProjectManager.Web are executable applications that depend on the shared and platform-dependent modules to provide Windows desktop and Web browser user interfaces respectively.

Although these Windows and Web applications can already be run and contain ready navigation, menu and other elements a typical line-of business (LOB) application may have, they are not very authentic and useful, as you have not yet created a data model definition, application logic and UI customizations.

Specify the Database Connection

By default, XAF applications by the Solution Wizard in Visual Studio 2010 are configured to use a local SQL Server Express database:

"Integrated Security=SSPI;Pooling=false;Data Source=.\SQLEXPRESS;Initial Catalog=SimpleProjectManager"

In Visual Studio 2012+ the LocalDB database is used:

"Integrated Security=SSPI;Pooling=false;Data Source=(localdb)\v11.1;Initial Catalog=SimpleProjectManager"

If this does not meet your needs, you can modify this in the SimpleProjectManager.Win\App.config and SimpleProjectManager.Web\Web.config files (refer to the connectionStrings element).

Note

If you experience any problems while following these steps, or you just want to let us know what you think, contact our support team (full and free technical support during the evaluation period is included).

Next topic: Define the Logical Data Model and Relationships

See Also