当前位置: 首页 > news >正文

学习008-02-05-03 Highlight Property Editors(突出显示属性编辑器)

Highlight Property Editors(突出显示属性编辑器)

This lesson explains how to format data that satisfies the specified criteria.
本课介绍如何格式化满足指定条件的数据。

The instructions below show how to do the following:
以下说明显示了如何执行以下操作:

  • Add the Conditional Appearance module to the application.(将条件外观模块添加到应用程序。)
  • *Highlight the DemoTask objects whose Status property is not set to Completed.(*突出显示状态属性未设置为已完成的DemoTask对象。)
  • Highlight the Priority property when it contains the High value.(当优先级属性包含高值时,突出显示它。)

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

1.Add the DevExpress.ExpressApp.ConditionalAppearance NuGet package to the MySolution.Module project. See the following topic for more information on how to install DevExpress NuGet packages: Choose Between Offline and Online DevExpress NuGet Feeds.
将DevExpress. ExpressApp.ConditionalAppearanceNuGet包添加到MySolutions.Module项目。有关如何安装DevExpress NuGet包的更多信息,请参阅以下主题:在离线和在线DevExpress NuGet Feeds之间进行选择。

2.In the MySolution.Module project, open the Module.cs file and add the Conditional Appearance module:
在MySolutions. Module项目中,打开Module.cs文件并添加条件外观模块:

C#

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Updating;namespace MySolution.Module;public sealed class MySolutionModule : ModuleBase {public MySolutionModule() {// ...RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule));}//...
}

3.Open the DemoTask class and apply the AppearanceAttribute attribute as displayed in the code sample below:
打开DemoTask类并应用外观属性,如下面的代码示例中所示:

C#

// ...
using DevExpress.ExpressApp.ConditionalAppearance;namespace MySolution.Module.BusinessObjects {[Appearance("FontColorRed", AppearanceItemType = "ViewItem", TargetItems = "*",Context = "ListView", Criteria = "Status!='Completed'", FontColor = "Red")][DefaultClassOptions][ModelDefault("Caption", "Task")]public class DemoTask : BaseObject {// ...}
}

The first parameter of the Appearance attribute is Id — a unique appearance rule identifier. The rest of the parameters are as follows:
外观属性的第一个参数是Id——一个唯一的外观规则标识符。其余参数如下:
在这里插入图片描述

Note
Follow the Criteria Language Syntax rules to specify the Criteria value.
按照条件语言语法规则指定条件值。

4.Apply the AppearanceAttribute attribute to the Priority property of the DemoTask class. As the first positional parameter, specify the Appearance Rule identifier (e.g., PriorityBackColorPink). Then, specify other parameters.
将外观属性应用于DemoTask类的优先级属性。作为第一个位置参数,指定外观规则标识符(例如PriorityBackColorPink)。然后,指定其他参数。

C#

using DevExpress.ExpressApp.ConditionalAppearance;
//...
public class DemoTask : BaseObject {// ...[Appearance("PriorityBackColorPink", AppearanceItemType = "ViewItem",Context = "Any", Criteria = "Priority=2", BackColor = "255, 240, 240")]public virtual Priority Priority { get; set; }// ...
}

The first parameter of the Appearance attribute is once again Id — a unique appearance rule identifier. The rest of the parameters are as follows:
外观属性的第一个参数再次是Id——一个唯一的外观规则标识符。其余参数如下:
在这里插入图片描述

5.Run the application. The DemoTask List View and Detail View display a conditional appearance:
运行应用程序。DemoTask List View和Detail View显示条件外观:

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

Windows Forms
在这里插入图片描述

Note
You can access these appearance rules from the Model Editor. Open the Model.DesignedDiffs.xafml file and navigate to the BOModel | DemoTask | AppearanceRules node. This node has two child nodes: FontColorRed and PriorityBackColorPink. XAF generates them automatically from the Appearance attributes applied to the DemoTask class and the DemoTask.Priority property. To create a new appearance rule in the Model Editor, add a child node to the AppearanceRules node.
您可以从模型编辑器访问这些外观规则。打开Model. DesignedDiffs.xafml文件并导航到BOModel|DemoTask|外观规则节点。该节点有两个子节点:FontColorRed和PriorityBackColorPink。XAF会根据应用于DemoTask类的外观属性和DemoTask.优先属性自动生成它们。要在模型编辑器中创建新的外观规则,请向外观规则节点添加一个子节点。

Next Lesson(下一课)

Attach Files to Objects
将文件附加到对象

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 每日面试题Day2
  • 介绍ES全称Elasticsearch
  • 【搜索二维矩阵】python刷题记录
  • 用爬虫玩转石墨文档
  • cms里文章页自定义文件名去掉html方法
  • Ant-Design-Vue快速上手指南与排坑
  • 深入解析三路快排:一种高效的排序算法
  • 数据结构+二叉排序树+哈希表
  • 【设计模式】组合模式
  • 从快到慢学习Git指令
  • 如何编写一个CMakeLists.txt文件(由简到难,较详细)
  • RS®ZN-Z8x 开关矩阵
  • 映客基于Apache SeaTunnel 打造高效的一站式数据集成平台
  • 自然语言处理顶会​​​​ACL 2024录用阿里云38篇论文,通义团队披露多项大模型前沿技术
  • html+css 实现hover 3D按钮特效
  • 【407天】跃迁之路——程序员高效学习方法论探索系列(实验阶段164-2018.03.19)...
  • 77. Combinations
  • ES6 学习笔记(一)let,const和解构赋值
  • java8 Stream Pipelines 浅析
  • Laravel核心解读--Facades
  • python3 使用 asyncio 代替线程
  • spring cloud gateway 源码解析(4)跨域问题处理
  • TCP拥塞控制
  • webpack+react项目初体验——记录我的webpack环境配置
  • Yii源码解读-服务定位器(Service Locator)
  • 翻译--Thinking in React
  • 关于Flux,Vuex,Redux的思考
  • 记录:CentOS7.2配置LNMP环境记录
  • 经典排序算法及其 Java 实现
  • 如何设计一个微型分布式架构?
  • 数组的操作
  • 吴恩达Deep Learning课程练习题参考答案——R语言版
  • 协程
  • 正则表达式小结
  • 第二十章:异步和文件I/O.(二十三)
  • 机器人开始自主学习,是人类福祉,还是定时炸弹? ...
  • ​经​纬​恒​润​二​面​​三​七​互​娱​一​面​​元​象​二​面​
  • #设计模式#4.6 Flyweight(享元) 对象结构型模式
  • (3)(3.5) 遥测无线电区域条例
  • (42)STM32——LCD显示屏实验笔记
  • (C#)Windows Shell 外壳编程系列4 - 上下文菜单(iContextMenu)(二)嵌入菜单和执行命令...
  • (C语言)求出1,2,5三个数不同个数组合为100的组合个数
  • (day 12)JavaScript学习笔记(数组3)
  • (附源码)springboot青少年公共卫生教育平台 毕业设计 643214
  • (附源码)计算机毕业设计SSM智能化管理的仓库管理
  • (一)认识微服务
  • (转)Linux整合apache和tomcat构建Web服务器
  • (转)VC++中ondraw在什么时候调用的
  • (最简单,详细,直接上手)uniapp/vue中英文多语言切换
  • *(长期更新)软考网络工程师学习笔记——Section 22 无线局域网
  • **PyTorch月学习计划 - 第一周;第6-7天: 自动梯度(Autograd)**
  • *p++,*(p++),*++p,(*p)++区别?
  • *算法训练(leetcode)第三十九天 | 115. 不同的子序列、583. 两个字符串的删除操作、72. 编辑距离
  • .NET / MSBuild 扩展编译时什么时候用 BeforeTargets / AfterTargets 什么时候用 DependsOnTargets?
  • .NET 3.0 Framework已经被添加到WindowUpdate