コード例 #1
0
        private IEnumerable <BFUDetailsRowColumn <TItem> > GetAdjustedColumns(IEnumerable <TItem> newItems, DetailsListLayoutMode newLayoutMode, SelectionMode newSelectionMode, CheckboxVisibility newCheckboxVisibility, IEnumerable <BFUDetailsRowColumn <TItem> > newColumns, bool forceUpdate, int resizingColumnIndex)
        {
            var columns           = Columns.EmptyIfNull();
            var lastWidth         = _lastWidth;
            var lastSelectionMode = _lastSelectionMode;

            if (!forceUpdate && _lastViewport.ScrollWidth == _viewport.ScrollWidth && SelectionMode == newSelectionMode && (Columns == null || newColumns == Columns))
            {
                return(Enumerable.Empty <BFUDetailsRowColumn <TItem> >());
            }

            // skipping default column builder... user must provide columns always

            IEnumerable <BFUDetailsRowColumn <TItem> > adjustedColumns = null;

            if (LayoutMode == DetailsListLayoutMode.FixedColumns)
            {
                adjustedColumns = GetFixedColumns(newColumns);

                foreach (var col in adjustedColumns)
                {
                    _columnOverrides[col.Key] = col.CalculatedWidth;
                }
            }
            else
            {
                if (resizingColumnIndex != -1)
                {
                    adjustedColumns = GetJustifiedColumnsAfterResize(newColumns, newCheckboxVisibility, newSelectionMode, _viewport.ScrollWidth, resizingColumnIndex);
                }
                else
                {
                    adjustedColumns = GetJustifiedColumns(newColumns, newCheckboxVisibility, newSelectionMode, _viewport.ScrollWidth, resizingColumnIndex);
                }

                foreach (var col in adjustedColumns)
                {
                    _columnOverrides[col.Key] = col.CalculatedWidth;
                }
            }



            return(adjustedColumns);
        }
コード例 #2
0
 private void AdjustColumns(IEnumerable <TItem> newItems, DetailsListLayoutMode newLayoutMode, SelectionMode newSelectionMode, CheckboxVisibility newCheckboxVisibility, IEnumerable <BFUDetailsRowColumn <TItem> > newColumns, bool forceUpdate, int resizingColumnIndex = -1)
 {
     _adjustedColumns = GetAdjustedColumns(newItems, newLayoutMode, newSelectionMode, newCheckboxVisibility, newColumns, forceUpdate, resizingColumnIndex);
 }