学习008-02-03-01 Add an Item to the Navigation Control(将项目添加到导航控件)

Add an Item to the Navigation Control(将项目添加到导航控件)

This lesson explains how to add the Notes item to the navigation control. When clicked, this Notes item is used to display a List View for the Note business class that you added in the previous lesson: Add an Action that Displays a Pop-Up Window.
本课介绍如何将Notes项添加到导航控件。单击时,此Notes项用于显示您在上一课中添加的Note业务类的列表视图:添加显示弹出窗口的操作。

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

1.Expand the MySolution.Module project and double-click the Model.DesignedDiffs.xafml file to invoke the Model Editor.
展开MySolutions. Module项目并双击Model.DesignedDiffs.xafml文件以调用模型编辑器。

The Model Editor pane consists of two major elements: the node tree and the context-sensitive property grid. When you select a node or focus a property, the Model Editor displays its type and a short description at the bottom of the pane.
模型编辑器窗格由两个主要元素组成:节点树和上下文相关属性网格。当您选择节点或聚焦属性时,模型编辑器会在窗格底部显示其类型和简短描述。
在这里插入图片描述

2.In the tree, navigate to the NavigationItems | Items | Default | Items node. The structure of the NavigationItems node and its child nodes corresponds to the structure of the navigation control. To add a child item to a navigation item, right-click the Items node and select Add… | NavigationItem in the context menu:
在树中,导航到NavigationItems|Items|Default|Items节点。NavigationItems节点及其子节点的结构对应于导航控件的结构。要将子项添加到导航项,请右键单击Items节点并在上下文菜单中选择Add…|NavigationItem:
在这里插入图片描述

3.Specify the following properties for the new item:
为新项目指定以下属性:

  • Set the View property to Note_ListView. This property specifies the type of View the application displays when you select the Notes item in the navigation control.(将View属性设置为Note_ListView。此属性指定在导航控件中选择Notes项时应用程序显示的View类型。)
  • Set the Caption property to Notes. This property specifies the name of the navigation item in the application’s UI.(将Caption属性设置为Notes。此属性指定应用程序UI中导航项的名称。)
  • Set the Id property to Note. This property specifies the unique node identifier.(将Id属性设置为Note。此属性指定唯一节点标识符。)
    在这里插入图片描述

When you change the View property value, the value of the ImageName property also changes. XAF checks the name of the View and looks for the corresponding image in the standard image library. If such image exists, XAF assigns it to the navigation item. For additional information, refer to the following lesson of this tutorial: Assign a Standard Image.
更改View属性值时,ImageName属性的值也会更改。XAF检查View的名称并在标准图片素材库中查找相应的图像。如果存在这样的图像,XAF会将其分配给导航项。有关其他信息,请参阅本教程的以下课程:分配标准图像。

4.Run the application. You can see the Notes navigation item in the navigation control. Select this item to see the List View of the Note entity class.
运行应用程序。您可以在导航控件中看到Notes导航项。选择此项以查看Note实体类的List View。

ASP.NET Core Blazor
在这里插入图片描述

Windows Forms
在这里插入图片描述

Next Lesson(下一课)

Rename and Rearrange Navigation Items
重命名和重新排列导航项

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

汤姆•猫

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

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

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

打赏作者

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

抵扣说明:

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

余额充值