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. Android 插件化开发(四):插件化实现方案

    在经过上面铺垫后,我们可以尝试整体实现一下插件化了.这里我们先介绍一下最简单的实现插件化的方案. 一.最简单的插件化实现方案 最简单的插件化实现方案,对四大组件都是适用的,技术面涉及如下: 1). 合 ...

  2. Android 项目优化(六):项目开发时优化技巧总结

    在之前我们讲了很多能够优化 Android 开发项目质量的方案,这些方案更多的是从一些比较专精的方向切入的,阐述的是一些比较重要且独立的优化方案. 本文我们将总结一下在日常开发过程中我们能够使用的一些 ...

  3. 简单实用的git命令

    1.下载项目 先进入目录然后使用jit $ git clone +"url" 2.项目配置 $ composer install 3.上传项目 $ git add . () $ g ...

  4. windows下MySQL解压版安装

    MySQL的安装 一.前期准备 获取MySQL解压版安装包(本文使用的是 [mysql-5.7.28-winx64.zip]版本) 获取方式: 通过官网下载,官方下载地址:“https://dev.m ...

  5. gorm操练记录

    这个数据库的定义蛮全的,先作个记录. package main import ( "time" "github.com/jinzhu/gorm" _ " ...

  6. Javassist中文技术文档

    本文译自Getting Started with Javassist,如果谬误之处,还请指出. bytecode读写 ClassPool Class loader 自有和定制 Bytecode操控接口 ...

  7. .NET Core 3.0 Preview 6中对ASP.NET Core和Blazor的更新

    我们都知道在6月12日的时候微软发布了.NET Core 3.0的第6个预览版.针对.NET Core 3.0的发布我们国内的微软MVP-汪宇杰还发布的官翻版的博文进行了详细的介绍.具体的可以关注&q ...

  8. Redis入门(四)-Java操作Redis

    <Redis入门>系列文章的第四篇,这一节看一下如何用Java版本的redis客户端工具--Jedis来操作redis. Jedis封装了丰富的api来对redis的五种数据类型 stri ...

  9. Pick of the Week'19 | Nebula 第 45 周看点--Nebula 到底是不是原生存储?

    每周五 Nebula 为你播报每周看点,每周看点由本周大事件.用户问答.Nebula 产品动态和推荐阅读构成. 今天是 2019 年第 45 个工作周的周五,来和 Nebula 看看本周有什么图数据库 ...

  10. Linux - CentOS 7 通过Yum源安装 Nginx

    添加源 sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.no ...