惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cyber Attacks, Cyber Crime and Cyber Security
P
Palo Alto Networks Blog
I
Intezer
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Recent Announcements
Recent Announcements
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
NISL@THU
NISL@THU
W
WeLiveSecurity
J
Java Code Geeks
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
月光博客
月光博客
量子位
N
News | PayPal Newsroom
阮一峰的网络日志
阮一峰的网络日志
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Securelist
T
Tenable Blog
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium
www.infosecurity-magazine.com
www.infosecurity-magazine.com
爱范儿
爱范儿
GbyAI
GbyAI
Webroot Blog
Webroot Blog
S
Security Affairs
The Cloudflare Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
A
About on SuperTechFans
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Help Net Security
Help Net Security
S
SegmentFault 最新的问题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题

博客园 - Tonyyang

【XAF】如何通过前缀或自定义架构将数据库表与内置系统表分开 Power Shell 7 和5.1 批量给pdf添加页码 DataTableHelper C# 多任务数据同步 【原】 XAF Localization改用百度翻译 C#百度翻译--亲测试可用 SqlQueryDynamic BOM导入 C#上传到FTP Server FREE OFFER - .NET App Security API (Role-based Access Control) 后台管理框架 Model to Model JSON序列化和反序列化日期时间的处理 Asp.net MVC 上传文件 Asp.net MVC bootstrap 穿梭框 EXT.NET Combox下拉Grid 转 Refresh Excel Pivot Tables Automatically Using SSIS Script Task SQL Server Integration Services SSIS最佳实践 PowerBI
[XAF] Declare Conditional Appearance Rules in Code
Tonyyang · 2025-01-03 · via 博客园 - Tonyyang
using DevExpress.ExpressApp.ConditionalAppearance;
//...
[Appearance("ActionState", AppearanceItemType = "Action",
    TargetItems = "Product.Deactivate",
        Criteria = "Status = 'Inactive'", Context = "Any", Enabled = false)]
public class Product : BaseObject {
    public virtual ProductStatus Status { get; set; }
    [Action(PredefinedCategory.RecordEdit, Caption = "Deactivate Product...", AutoCommit = true,
     TargetObjectsCriteria = "Status = 'Active'",
      SelectionDependencyType = MethodActionSelectionDependencyType.RequireSingleObject)]
    public void Deactivate() {
        Status = ProductStatus.Inactive;
    }
}

// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.
using DevExpress.ExpressApp.ConditionalAppearance;
//...
public class Product : BaseObject {
    public virtual decimal Price { get; set; }
    public virtual ProductStatus Status { get; set; }
    [Appearance("RuleMethod", AppearanceItemType = "ViewItem", TargetItems = "*", Context = "ListView",
     BackColor = "Green", FontColor = "Black")]
    public bool RuleMethod() {
        if (Price < 10 && Status == ProductStatus.Active) {
            return true;
        }
        else {
            return false;
        }
    }
}

// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.