In this lesson, you will learn how to modify Action properties. The ClearTasks Action will be used. To see how the Action was implemented, refer to the Add a Simple Action lesson. In this lesson, you will add a tooltip, confirmation message and shortcut to it.

在本课中,您将学习如何修改 Action 属性。将使用清除任务操作。要查看操作是如何实现的,请参阅添加简单按钮课程。在本课中,您将向其添加工具提示、确认消息和快捷方式。

Note 注意

Before proceeding, take a moment to review the following lessons.

在继续之前,请花点时间复习以下课程。

  • Add a Simple Action
  • Place an Action in a Different Location
  • Since the ClearTasksAction is implemented in the common application module, you can specify its properties directly in this module. To do this, invoke the Model Editor by double-clicking the Model.DesignedDiffs.xafml file in the MySolution.Module project:
  • In the Model Editor, navigate to the ActionDesign | Actions node. Locate the ClearTasksAction node. To the right, the Action's settings are represented by properties. These properties are separated into collapsible categories.
  • Navigate to the Misc category. By default, the Tooltip property is set to Caption. Set it to "Clear the current Contact's tasks" instead. Set the Shortcut property to "Control+Shift+C", to specify a shortcut for the Action. Note that the specified shortcut will be displayed along with the Tooltip property value in the Action's tooltip. By default, the ConfirmationMessage property is set to the Action's ActionBase.ConfirmationMessage property value, which is specified in code. Replace this value with "Are you sure you want to clear the {0}'s Tasks list?". The "{0}" format item will be substituted with the object's default property value. A property can be specified as default via the DefaultProperty property of the BOModel | <Class> node in the Model Editor. Alternatively, the DefaultProperty attribute can be applied to the property's business class declaration.

  • 添加简单操作
  • 将操作放置在其他位置
  • 由于 ClearTasksAction 是在通用应用程序模块中实现的,因此可以直接在此模块中指定其属性。为此,请通过双击"模型.设计Diffs.xafml"项目中的"模型编辑器"来调用模型编辑器:
  • 在模型编辑器中,导航到操作设计 |操作节点。找到"清除任务操作"节点。在右侧,操作的设置由属性表示。这些属性被分隔成可折叠的类别。
  • 导航到杂项类别。默认情况下,"工具提示"属性设置为"标题"。请改为将其设置为"清除当前联系人的任务"。将快捷方式属性设置为"控制_Shift_C",以指定操作的快捷方式。请注意,指定的快捷方式将与"工具提示"工具提示中的"工具提示"属性值一起显示。默认情况下,"确认消息"属性设置为操作的操作Base.确认消息属性值,该属性值在代码中指定。将此值替换为"是否确实要清除{0}的任务列表?""{0}"格式项将替换为对象的默认属性值。可以通过 BOModel 的"默认属性"属性将属性指定为默认值 |模型编辑器中的<Class>节点。或者,DefaultProperty 属性可以应用于属性的业务部门级声明。
Note 注意
Shortcuts are defined by simple strings that you need to type manually. The IModelAction.Shortcut property is used to parse the strings. Note that shortcuts will only work in a WinForms application.

快捷方式由需要手动键入的简单字符串定义。IModelAction.快捷方式属性用于分析字符串。请注意,快捷方式仅在 WinForms 应用程序中工作。

The current object identifier will be inserted into the confirmation message if the Action's SelectionDependencyType property is not set to "Independent". So, assign the "RequireSingleObject" value to the SelectionDependencyType property. This property belongs to the Behavior category. You can also set this property to "RequireMultipleObjects". In this case, the count of selected objects will be substituted to the confirmation message.
如果操作的"选择依赖类型"属性未设置为"独立",则当前对象标识符将插入到确认消息中。因此,将"需要单一对象"值分配给选择依赖类型属性。此属性属于行为类别。您还可以将此属性设置为"需要多个对象"。在这种情况下,所选对象的计数将替换为确认消息。

  • Run the WinForms or ASP.NET application and invoke the Detail View of any object, by double-clicking an existing one or creating a new one. Check to see if the Clear Tasks button has the required tooltip, can be executed via the specified shortcut, and a confirmation message with the specified text is invoked.
  • 通过双击现有对象或创建新对象,运行 WinForms 或ASP.NET应用程序并调用任何对象的详细信息视图。检查"清除任务"按钮是否具有所需的工具提示,是否可以通过指定的快捷方式执行,并调用包含指定文本的确认消息。

WinForms Application

WinForms 应用程序

ASP.NET Application

ASP.NET应用程序

Note 注意

You can also set an image for an Action. For details, refer to the Assign a Custom Image topic.

您还可以为操作设置图像。有关详细信息,请参阅分配自定义图像主题。

You can see the changes made in this lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file, located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

您可以在本课中为模型调用的模型编辑器中所做的更改。主演示模块项目。主演示应用程序安装在%PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

.

Specify Action Settings 指定按钮设置的更多相关文章

  1. loadrunner 运行脚本-Run-time Settings之Pacing设置

    运行脚本-Run-time Settings之Pacing设置 by:授客 QQ:1033553122   As soon as the previous iteration ends 前一个迭代一结 ...

  2. loadrunner 运行脚本-Run-time Settings之Preferences设置

    运行脚本-Run-time Settings之Preferences设置 by:授客 QQ:1033553122 打开Preferences设置对话框,这里提供了对运行时的参数选择设置 Enable ...

  3. asp.net 微信企业号办公系统-流程设计--流程步骤设置-按钮设置

    按钮设置是配置当前步骤的处理者可以执行哪些操作,每个按钮都有对应的执行脚本(javascript脚本). 从左边的按钮列表中选择当前步骤需要的按钮. 注意:如果是流程最后一步则要配置完成按钮而不是发送 ...

  4. javascript 回车提交指定按钮

    当页面上有多个提交按钮时,使用回车键会触发第一个按钮的点击事件.现在我们想触发指定按钮的提交,只需要在最后输入的文本框中加入 onkeydown 事件,如下 <asp:TextBox ID=&q ...

  5. .NET开源工作流RoadFlow-流程设计-流程步骤设置-按钮设置

    按钮设置是配置当前步骤的处理者可以执行哪些操作,每个按钮都有对应的执行脚本(javascript脚本). 从左边的按钮列表中选择当前步骤需要的按钮. 注意:如果是流程最后一步则要配置完成按钮而不是发送 ...

  6. C# winform 按钮设置左边图标

    按钮设置操作如下: 1.先设置按钮图标,再设置图标的对齐方式 2.再设置按钮字体的对齐方式. 3.最后设置排列: TextImageRelation:设置为ImageBeforeText

  7. java窗口按钮设置五个方向

    java窗口按钮设置五个方向 代码如下: package Day08; import java.awt.BorderLayout;import javax.swing.JButton;import j ...

  8. iOS-UIView指定圆角设置

    圆角设置可以指定左上.左下.右上.右下角:单个指定或多个指定. ///设置圆角[左上.右上角] - (void)setCircular{ UIBezierPath *maskPath = [UIBez ...

  9. JavaFX如何为按钮设置快捷键?

    JavaFX为按钮设置快捷键的方式有很多,先说下常见的一种. 第一种: KeyCodeCombination kc1 = new KeyCodeCombination(KeyCode.W, KeyCo ...

随机推荐

  1. Python批量更新模块的方法【面试必学】

    前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理.作者:ranchlin      小编的环境为win10+python 3. ...

  2. Linux命令-grep,sed,awk

    grep (global search regular expression[RE] and print out the line) 正则表达式全局搜索并将行打印出来 在文件中查找包含字符串" ...

  3. 高性能mysql——高性能索引策略

    <高性能MySQL>读书笔记 一. 索引的优点 1. 索引可以让服务器快速定位到表的指定位置,大大减少了服务器需要扫描的数量: 2. 最常见的B-Tree索引按照顺序存储数据,可以用来做o ...

  4. 前后端分离crud(跨域问题)讲解

    1 前后端分离 1.1 后端 ssm+maven 多模块 swagger 文档描述(代码拷贝过来,就可以生成了,https://www.cnblogs.com/wings-xh/p/11991511. ...

  5. 控制DIV移动

    键盘控制DIV移动 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> < ...

  6. 达梦7入门技术总结--DCA级别

    说明: 1)该实验所有过程均是本人亲自敲命令完成,所有代码运行正确 2)安装过程使用的是suse11 sp3操作系统,后续的实验过程换成了麒麟中标,因此部分路径可能存在差异 3)安装过程使用了命令行安 ...

  7. 阿里巴巴供应链平台事业部2020届秋招-Java工程师

    阿里巴巴供应链平台事业部,2020届秋季校园招聘开始啦!Java开发工程师虚位以待,机会难得,占坑抓紧. 入职就发师兄,一对一师兄辅导. 在这里,你将有机会接触阿里集团的所有数据库.中间件等基础设施. ...

  8. OS之进程和线程

    1. 线程是程序执行流的最小单元. 一个标准的线程由线程ID,当前指令指针PC,寄存器集合和堆栈组成. 2. 通常意义上,一个进程由一个到多个线程组成,各个线程之间共享程序的的内存空间,包括代码段.数 ...

  9. JavaScript 函数工具

    组 all:布尔全等判断 const all = (arr, fn = Boolean) => arr.every(fn); all([4, 2, 3], x => x > 1); ...

  10. 关于独显A卡利用率一直是0不运行的问题

    情况: 独显一直是0,玩游戏时核显,也就是GPU-0快满了GPU-1也是0,跟没有一样,怀疑自己买电脑的时候是不是被骗了. 在高级电源选项中,有个可切换动态显卡->全局设置的选项,设置成最大化性 ...