English 中文(简体)
WPF: How Do 我通过财产编辑/XAML编辑编辑编辑编辑编辑编辑了儿童班级的基数/父母等级的栏目。
原标题:WPF: How Do I edit the column properties of a base/parent class in the child class through the property editor/XAML?
  • 时间:2009-10-02 20:45:20
  •  标签:

我创建了一个称为“生产、生产、储存和消费”的班子,来自班级用户目录。 这个基类没有XAML。 其宗旨是作为电网的基级,我把电网装在电离层内,以便在电离层后加以改变。 在基类的构造者中,我还设置了栏目,并添加到Grid的藏书上。 我创建了一个名为“哥伦”的公共财产,所有财产都属于“网格”的“哥伦”财产收集。

我设立了儿童班,来自生产、生产、加工和生产。 在继承的财产编辑中,有我的哥伦斯藏书。 我可以通过财产编辑开始收集,并增加新的栏目。 然而,尽管我可以直观地看到信管上的栏目,但该栏的编辑并不包含我在基数中增加的栏目。

假设这一点,是因为我在基数中增加的栏目不是儿童XAML。 如果我通过儿童XAML增加一栏,就会产生重复一栏,因为这些栏子是在基地添加的。 我怎么能够利用在儿童身上出现的密码来推断在基地添加的栏目的财产?

public partial class ProductionDataUserControlBase : UserControl
    {
        private RadGridView _grdProdData;
        private Boolean _InitCalled = false; //Boolean variable used to control whether init was previously called.
        //This is because the loaded event may be fired multiple times depending
        //on what type of control it s been placed into.

        public ProductionDataUserControlBase()
        {
            InitializeComponent();
        }        


        public Telerik.Windows.Controls.GridViewColumnCollection Columns
        {
            get
            {
                return _grdProdData.Columns;            
            }            
        }        

        protected virtual void InitializeComponent()
        {
            if (!_InitCalled)
            {                
                InitializeGrid();
                Columns = _grdProdData.Columns;
                this.AddChild(_grdProdData);                                                

                _InitCalled = true;
            }
        }

        private void InitializeGrid()
        {
            Telerik.Windows.Controls.GridViewColumn grdCol = null;

            this._grdProdData = new RadGridView();
            this._grdProdData.AutoGenerateColumns = false;

            grdCol = new Telerik.Windows.Controls.GridViewColumn() { HeaderText = "PSTAT", Name = "grdColPSTAT", UniqueName = "PSTAT" };
            _grdProdData.Columns.Add(grdCol);

            grdCol = new Telerik.Windows.Controls.GridViewColumn() { HeaderText = "PCONO", Name = "grdColPCONO", UniqueName = "PCONO" };
            _grdProdData.Columns.Add(grdCol);

         }

    }

<ProductionDataUserControlBase x:Class="AmerenProductionDataUserControl"    
            xmlns:MSControls="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns="clr-namespace:AmerenProductionDataUserControl;assembly=AmerenProductionDataUserControl" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

    </ProductionDataUserControlBase>

public partial class AmerenProductionDataUserControl : ProductionDataUserControlBase
        {

            public AmerenProductionDataUserControl()
            {
                InitializeComponent();                                            
            }
        }
问题回答

象你这样的声音要么凌驾于藏书的内容,要么压倒财产。





相关问题
热门标签