Create a Cross-Platform .NET App UI Application
- 3 minutes to read
This topic describes how to use the Solution Wizard to create a Cross-Platform .NET App UI (XAF) application and specify a database connection string.
In Visual Studio’s main menu, select File | New | Project… to invoke the Create a new project dialog.
Select DevExpress v23.1 XAF Template Gallery and click Next.
Specify the project name (SimpleProjectManager) and click Create.
In the invoked Template Gallery window, select XAF Solution Wizard (.NET 6) and click Run Wizard.
On the first page of the Solution Wizard, you can select target platforms. Select two options – Desktop (Windows Forms) and Web (ASP.NET Core Blazor). Click Next.
Choose the Entity Framework Core ORM library.
For additional information on how to choose an ORM that suits your needs, refer to the following topic: Why We Recommend EF Core over XPO for New Development.
Choose None as the authentication type for your application. In this tutorial, we do not use the XAF Security System. Click Next.
On this page, you can select the ready-to-use XAF modules you want to add to your application. For the purposes of this tutorial, do not select anything and click Finish.
The solution contains the following projects:
- A module project that contains platform-independent code. Use this project to define the data model and change UI settings of all target platforms.
- An ASP.NET Core Blazor application that generates a user interface based on the data model you define in SimpleProjectManager.Module.
- A Windows Forms application that generates a user interface based on the data model you define in SimpleProjectManager.Module.
Refer to the following topic for more information on projects in an XAF solution: Application Solution Structure.
When you create a new application, the application wizard attempts to find an installed Microsoft SQL Server instance (LocalDB or Express) and sets the connection string accordingly. You can also connect to a different database system as described in the following topic: Connect an XAF Application to a Database Provider.
Now you can run the application. Click Start Debugging or press F5.
The ASP.NET Core Blazor project is set as the startup project. To run the Windows Forms application, right-click the SimpleProjectManager.Win project in the Solution Explorer and select the Set as Startup Project option in the context menu.
The following images show the resulting ASP.NET Core Blazor and Windows Forms applications:
- ASP.NET Core Blazor
- Windows Forms
XAF creates the application’s UI based on the supplied data model. Since you did not create any entity classes yet, the first run shows a basic version of the application.