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

推荐订阅源

cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园_首页
M
MIT News - Artificial intelligence
月光博客
月光博客
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
The Cloudflare Blog
D
Docker
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
Vercel News
Vercel News
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
The Register - Security
The Register - Security
B
Blog
Recorded Future
Recorded Future
J
Java Code Geeks
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
F
Fortinet All Blogs
B
Blog RSS Feed
Project Zero
Project Zero
The Hacker News
The Hacker News
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
Jina AI
Jina AI
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
G
Google Developers Blog
GbyAI
GbyAI
S
Securelist
T
Tenable Blog
博客园 - 【当耐特】
Security Latest
Security Latest
人人都是产品经理
人人都是产品经理
T
Tor Project blog
Latest news
Latest news
P
Proofpoint News Feed
T
The Blog of Author Tim Ferriss

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