学习008-01-01 Create a Cross-Platform .NET App UI Application(创建一个跨平台的.NET 应用程序用户界面应用程序)

Create a Cross-Platform .NET App UI Application(创建一个跨平台的.NET 应用程序用户界面应用程序)

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.
本主题介绍如何使用解决方案向导创建跨平台。NET应用程序UI(XAF)应用程序并指定数据库连接字符串。

Step-by-Step Instructions(分步说明)

1.In Visual Studio’s main menu, select File | New | Project… to invoke the Create a new project dialog.
在Visual Studio的主菜单中,选择文件|新建|项目…以调用创建新项目对话框。
在这里插入图片描述
2.Select DevExpress XAF Template Gallery and click Next.
选择DevExpress XAF模板库并单击下一步。
在这里插入图片描述
3.Specify the project name (SimpleProjectManager) and click Create.
指定项目名称(SimpleProjectManager)并单击创建。
在这里插入图片描述
4.In the invoked Template Gallery window, switch to the .NET section. Select XAF Solution Wizard (.NET) and click Run Wizard.
在调用的模板库窗口中,切换到。NET部分。选择XAF解决方案向导(. NET)并单击运行向导。
在这里插入图片描述
5.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.
在解决方案向导的第一页上,您可以选择目标平台。选择两个选项-桌面(Windows窗体)和Web(ASP.NETCore Blazor)。单击下一步。
在这里插入图片描述
6.Choose the Entity Framework Core ORM library.
选择实体框架核心ORM库。
在这里插入图片描述
7.In the next window, you can enable XAF’s functional testing and multitenancy capabilities. Do not select anything and continue to the next step since these options are not required for this tutorial.
在下一个窗口中,您可以启用XAF的功能测试和多租户功能。不要选择任何内容并继续下一步,因为本教程不需要这些选项。
在这里插入图片描述
8.Choose None as the authentication type for your application. In this tutorial, we do not use the XAF Security System. Click Next.
选择无作为应用程序的身份验证类型。在本教程中,我们不使用XAF安全系统。单击下一步。
在这里插入图片描述
9.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.
在此页面上,您可以选择要添加到应用程序的即用型XAF模块。出于本教程的目的,不要选择任何内容并单击完成。
在这里插入图片描述

Solution Structure(解决方案结构)

The solution contains the following projects:
该解决方案包含以下项目:

SimpleProjectManager.Module

A module project that contains platform-independent code. Use this project to define the data model and change UI settings of all target platforms.
包含platform-independent代码的模块项目。使用此项目定义数据模型并更改所有目标平台的UI设置。

SimpleProjectManager.Blazor.Server

An ASP.NET Core Blazor application that generates a user interface based on the data model you define in SimpleProjectManager.Module.
一个ASP.NETCore Blazor应用程序,它根据您在SimpleProjectManager模块中定义的数据模型生成用户交互界面。

SimpleProjectManager.Win

A Windows Forms application that generates a user interface based on the data model you define in SimpleProjectManager.Module.
一个Windows窗体应用程序,它根据您在SimpleProjectManager模块中定义的数据模型生成用户交互界面。

在这里插入图片描述

Refer to the following topic for more information on projects in an XAF solution: Application Solution Structure.
有关XAF解决方案中项目的更多信息,请参阅以下主题:应用程序解决方案结构。

Database Connection(数据库连接)

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.
创建新应用程序时,应用程序向导会尝试查找已安装的MicrosoftSQLServer实例(LocalDB或Express)并相应地设置连接字符串。您还可以按照以下主题中的说明连接到不同的数据库系统:将XAF应用程序连接到数据库提供程序。

First Run(首次运行)

Now you can run the application. Click Start Debugging or press F5.
现在您可以运行应用程序了。单击开始调试或按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.
ASP.NETCore Blazor项目设置为启动项目。要运行Windows窗体应用程序,请右键单击解决方案资源管理器中的SimpleProjectManager.Win项目,然后在上下文菜单中选择设置为启动项目选项。

The following images show the resulting ASP.NET Core Blazor and Windows Forms applications:
以下图片显示了生成的ASP.NETCore Blazor和Windows窗体应用程序:

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.
XAF基于提供的数据模型创建应用程序的UI。由于您还没有创建任何实体类,因此第一次运行显示了应用程序的基本版本。

简单录制的操作步骤:

简单录制的操作步骤

Next lesson(下一课)

Define the Data Model and Set the Initial Data
定义数据模型并设置初始数据

  • 17
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汤姆•猫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值