Exemple #1
0
        public void PrepareCell(TableViewCellsPresenter parent, int idx)
        {
            ParentCellsPresenter = parent;
            _parentTableView = parent.ParentTableView;

            var column = _parentTableView.Columns[idx];

            //IsSelected = ParentCellsPresenter.IsSelected() && (ParentTableView.FocusedColumnIndex == column.ColumnIndex);

            if (_column != column)
            {
                _column = column;
                Width = column.Width;
                BindingOperations.ClearBinding(this, WidthProperty);
                BindingOperations.SetBinding(this, WidthProperty, column.WidthBinding);
                Focusable = _parentTableView.CellNavigation;
            }
            column.GenerateCellContent(this);
        }
        public void PrepareRow(TableView parent, object dataItem)
        {
            ParentTableView = parent;

            Focusable = ParentTableView.CellNavigation == false;

            Item = dataItem;

            // set the selected state for this row
            var scp = ParentTableView.SelectedCellsPresenter;
            if (scp != null)
            {
                IsSelected = ParentTableView.IndexOfRow(scp) == ParentTableView.IndexOfRow(this);
            }
        }
        protected override void OnIsItemsHostChanged(bool oldIsItemsHost, bool newIsItemsHost)
        {
            base.OnIsItemsHostChanged(oldIsItemsHost, newIsItemsHost);

            var rowPresenter = TableViewUtils.FindParent<TableViewCellsPresenter>(this);

            if (rowPresenter == null)
            {
                return;
            }

            rowPresenter.CellsPanel = this;
            ParentTableView = rowPresenter.ParentTableView;
            Style = ParentTableView.CellsPanelStyle;
        }