Display a Nested Property Editor in a Detail View(在详细信息视图中显示嵌套属性编辑器)
This lesson explains how to make the editor of a property visible in a Detail View.
本课介绍如何使属性的编辑器在详细信息视图中可见。
The instructions below show how to locate the Department.Office nested property and make it visible in the Employee Detail View.
下面的说明展示了如何定位Department.Office嵌套属性并使其在员工详细信息视图中可见。
Note
Before you proceed, take a moment to review the previous lesson:
在继续之前,请花点时间回顾上一课:
- Place an Action in a Different Location
Step-by-Step Instructions(分步说明)
1.Open the Model.DesignedDiffs.xafml file in the Model Editor.
在模型编辑器中打开Model. DesignedDiffs.xafml文件。
2.Navigate to the Views | MySolution.Module.BusinessObjects | Employee node. Expand the Employee_DetailView child node and click the Layout node.
导航到视图|MySolutions. Module.BusinessObjects|员工节点。展开Employee_DetailView子节点并单击布局节点。
3.The Model Editor displays a design surface that imitates the Employee Detail View. Right-click the View’s empty space and choose Customize Layout from the context menu:
模型编辑器显示一个模仿员工详细信息视图的设计图面。右键单击视图的空白空间,然后从上下文菜单中选择自定义布局:
4.In the invoked Customization window, click the Add button:
在调用的自定义窗口中,单击添加按钮:
5.In the Object Model dialog, expand the Department node, check the Office checkbox, and click OK.
在对象模型对话框中,展开部门节点,选中Office复选框,然后单击确定。
6.The Office: item appears on the Hidden Items tab of the Customization window:
Office:项目出现在自定义窗口的隐藏项目选项卡上:
7.Drag the Office: item to the required position of the Employee Detail View.
将Office:项目拖到员工详细信息视图的所需位置。
8.Run the application, open the Employee Detail View, and find the Office editor:
运行应用程序,打开员工详细信息视图,然后找到Office编辑器:
ASP.NET Core Blazor
Windows Forms
Runtime Customization in ASP.NET Core Blazor(ASP.NET核心Blazor中的运行时定制)
In an XAF ASP.NET Core Blazor application, you can also customize the Detail View layout at runtime. For more information, refer to the following topic: Runtime Layout Customization in ASP.NET Core Blazor Applications.
在XAFASP.NETCore Blazor应用程序中,您还可以在运行时自定义详细信息视图布局。有关详细信息,请参阅以下主题:ASP.NETCore Blazor应用程序中的运行时布局自定义。
1.Navigate to the Employee Detail View. Right-click the layout and select the Customize Layout option in the context menu.
导航到员工详细信息视图。右键单击布局并在上下文菜单中选择自定义布局选项。
2.In the invoked Customization form, click the Customize button under the Hidden Items list.
在调用的自定义表单中,单击隐藏项目列表下的自定义按钮。
3.In the invoked Object Model dialog window, expand the Department node, check the Office checkbox, and click OK.
在调用的对象模型对话框窗口中,展开部门节点,选中Office复选框,然后单击确定。
Note
If you have an extensive and complicated data model, the structure in the Object Model dialog window may be confusing. To see the path to a reference property, hover your mouse over the property in the Object Model dialog window. This may help you distinguish between similar properties.
如果您有一个广泛而复杂的数据模型,对象模型对话框窗口中的结构可能会令人困惑。要查看引用属性的路径,请将鼠标悬停在对象模型对话框窗口中的属性上。这可能有助于您区分相似的属性。
4.The Office item now appears in the Hidden Items list of the Customization window.
Office项现在出现在自定义窗口的隐藏项列表中。
5.Drag the Office item to the required position in the Employee Detail View.
将Office项拖到员工详细信息视图中所需的位置。
Note
To remove unnecessary hidden items, uncheck them in the Object Model dialog window.
要删除不必要的隐藏项,请在对象模型对话框窗口中取消选中它们。