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

推荐订阅源

NISL@THU
NISL@THU
Latest news
Latest news
Scott Helme
Scott Helme
T
Tenable Blog
Simon Willison's Weblog
Simon Willison's Weblog
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
K
Kaspersky official blog
The Hacker News
The Hacker News
Jina AI
Jina AI
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cisco Blogs
S
Secure Thoughts
雷峰网
雷峰网
Project Zero
Project Zero
T
Troy Hunt's Blog
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Know Your Adversary
Know Your Adversary
爱范儿
爱范儿
博客园 - 聂微东
N
News and Events Feed by Topic
The Cloudflare Blog
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Schneier on Security
Schneier on Security
Recent Announcements
Recent Announcements
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Vercel News
Vercel News
C
Check Point Blog
Cisco Talos Blog
Cisco Talos Blog
Apple Machine Learning Research
Apple Machine Learning Research
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
TaoSecurity Blog
TaoSecurity Blog
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
P
Palo Alto Networks Blog
云风的 BLOG
云风的 BLOG

博客园 - 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.