コード例 #1
0
ファイル: TreeGridCellsPanel.cs プロジェクト: yungtau/oea
        /// <summary>
        /// 连接到可视父元素,连接成功,则返回 true。
        /// </summary>
        /// <returns></returns>
        private bool TryConnect()
        {
            if (!this.IsConnected)
            {
                this._cellsPresenter = ItemsControl.GetItemsOwner(this) as TreeGridCellsPresenter;
                if (this._cellsPresenter != null)
                {
                    this._cellsPresenter.InternalItemsHost = this;

                    var row = this._cellsPresenter.Row;
                    if (row != null)
                    {
                        row.CellsPanel = this;

                        this._treeGrid = row.TreeGrid;
                        if (this._treeGrid != null)
                        {
                            InternalCollectionChangedEventManager.AddListener(this._treeGrid.Columns, this);

                            this._rowsPanel = this._treeGrid.RowsPanel;

                            //分组显示时,RowsPanel 为 null,也不能进行虚拟化操作。
                            this._isVirtualizing = this._rowsPanel != null && this._treeGrid.IsColumnsVirtualizingEnabled;
                            this._isRecycleMode  = this._treeGrid.IsRecycleMode;
                        }
                    }
                }
            }

            return(this.IsConnected);
        }
コード例 #2
0
ファイル: TreeGridCellsPanel.cs プロジェクト: yungtau/oea
        private void Disconnect()
        {
            if (this.IsConnected)
            {
                InternalCollectionChangedEventManager.RemoveListener(this._treeGrid.Columns, this);

                this._rowsPanel = null;
                this._treeGrid  = null;

                var row = this._cellsPresenter.Row;
                if (row != null)
                {
                    row.CellsPanel = null;
                }

                this._cellsPresenter.InternalItemsHost = null;
                this._cellsPresenter = null;
            }
        }
コード例 #3
0
ファイル: TreeGridCellsPanel.cs プロジェクト: 569550384/Rafy
        /// <summary>
        /// 连接到可视父元素,连接成功,则返回 true。
        /// </summary>
        /// <returns></returns>
        private bool TryConnect()
        {
            if (!this.IsConnected)
            {
                this._cellsPresenter = ItemsControl.GetItemsOwner(this) as TreeGridCellsPresenter;
                if (this._cellsPresenter != null)
                {
                    this._cellsPresenter.InternalItemsHost = this;

                    var row = this._cellsPresenter.Row;
                    if (row != null)
                    {
                        row.CellsPanel = this;

                        this._treeGrid = row.TreeGrid;
                        if (this._treeGrid != null)
                        {
                            InternalCollectionChangedEventManager.AddListener(this._treeGrid.Columns, this);

                            this._rowsPanel = this._treeGrid.RowsPanel;

                            //分组显示时,RowsPanel 为 null,也不能进行虚拟化操作。
                            this._isVirtualizing = this._rowsPanel != null && this._treeGrid.IsColumnsVirtualizingEnabled;
                            this._isRecycleMode = this._treeGrid.IsRecycleMode;
                        }
                    }
                }
            }

            return this.IsConnected;
        }
コード例 #4
0
ファイル: TreeGridCellsPanel.cs プロジェクト: 569550384/Rafy
        private void Disconnect()
        {
            if (this.IsConnected)
            {
                InternalCollectionChangedEventManager.RemoveListener(this._treeGrid.Columns, this);

                this._rowsPanel = null;
                this._treeGrid = null;

                var row = this._cellsPresenter.Row;
                if (row != null) { row.CellsPanel = null; }

                this._cellsPresenter.InternalItemsHost = null;
                this._cellsPresenter = null;
            }
        }