XAF 如何基於商務規則禁用屬性

來源:互聯網
上載者:User

標籤:

// Developer Express Code Central Example:// How to: Disable Property Editors Based on a Business Rule// // This example demonstrates how to hide and disable property editors via the// Conditional Appearance module (the obsolete Conditional Editor State module is// used in versions prior to 11.2). The complete description is available in the// How to: Disable Property Editors Based on a Business Rule// (ms-help://DevExpress.Xaf/CustomDocument3221.htm) help topic.// // You can find sample updates and versions for different programming languages here:// http://www.devexpress.com/example=E1672using System;using System.ComponentModel;using DevExpress.Xpo;using DevExpress.Data.Filtering;using DevExpress.ExpressApp;using DevExpress.Persistent.Base;using DevExpress.Persistent.BaseImpl;using DevExpress.Persistent.Validation;using DevExpress.ExpressApp.ConditionalAppearance;using DevExpress.ExpressApp.Editors;namespace EditorStateExample.Module {    [DefaultClassOptions]    [ImageName("BO_Person")]    public class Contact : BaseObject {        public Contact(Session session) : base(session) { }                public string Name {            get { return GetPropertyValue<string>("Name"); }            set { SetPropertyValue<string>("Name", value); }        }        [ImmediatePostData]        public bool IsMarried {            get { return GetPropertyValue<bool>("IsMarried"); }            set { SetPropertyValue<bool>("IsMarried", value); }        }        [Appearance("Single", Visibility = ViewItemVisibility.Hide, Criteria = "!IsMarried", Context="DetailView")]        public string SpouseName {            get { return GetPropertyValue<string>("SpouseName"); }            set { SetPropertyValue<string>("SpouseName", value); }        }        [ImmediatePostData]        public string Address1 {            get { return GetPropertyValue<string>("Address1"); }            set { SetPropertyValue<string>("Address1", value); }        }        [Appearance("AddressOneIsEmpty", Enabled = false, Criteria = "IsNullOrEmpty(Address1)")]        public string Address2 {            get { return GetPropertyValue<string>("Address2"); }            set { SetPropertyValue<string>("Address2", value); }        }    }}
轉載於:http://www.cnblogs.com/Tonyyang/

XAF 如何基於商務規則禁用屬性

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.