public DataGrid()
        {
            TabNavigation = KeyboardNavigationMode.Once;
            KeyDown += DataGrid_KeyDown;
            KeyUp += DataGrid_KeyUp;
            GotFocus += DataGrid_GotFocus;
            LostFocus += DataGrid_LostFocus;
            IsEnabledChanged += DataGrid_IsEnabledChanged;

            _loadedRows = new List<DataGridRow>();
            _selectedItems = new DataGridSelectedItemsCollection(this);
            _rowGroupHeaderStyles = new ObservableCollection<Style>();
            _rowGroupHeaderStyles.CollectionChanged += RowGroupHeaderStyles_CollectionChanged;
            _rowGroupHeaderStylesOld = new List<Style>();
            RowGroupHeadersTable = new IndexToValueTable<DataGridRowGroupInfo>();
            _validationResults = new List<ValidationResult>();

            DisplayData = new DataGridDisplayData(this);
            ColumnsInternal = CreateColumnsInstance();

            RowHeightEstimate = DATAGRID_defaultRowHeight;
            RowDetailsHeightEstimate = 0;
            _rowHeaderDesiredWidth = 0;

            DataConnection = new DataGridDataConnection(this);
            _showDetailsTable = new IndexToValueTable<Visibility>();
            _collapsedSlotsTable = new IndexToValueTable<Visibility>();

            AnchorSlot = -1;
            _lastEstimatedRow = -1;
            _editingColumnIndex = -1;
            _mouseOverRowIndex = null;
            CurrentCellCoordinates = new DataGridCellCoordinates(-1, -1);

            RowGroupHeaderHeightEstimate = DATAGRID_defaultRowHeight;

            DefaultStyleKey = typeof(DataGrid);
        }
        public DataGrid()
        {
            this.TabNavigation = KeyboardNavigationMode.Once;
            this.KeyDown += new KeyEventHandler(DataGrid_KeyDown);
            this.KeyUp += new KeyEventHandler(DataGrid_KeyUp);
            this.GotFocus += new RoutedEventHandler(DataGrid_GotFocus);
            this.LostFocus += new RoutedEventHandler(DataGrid_LostFocus);
            this.IsEnabledChanged += new DependencyPropertyChangedEventHandler(DataGrid_IsEnabledChanged);

            this._loadedRows = new List<DataGridRow>();
            this._lostFocusActions = new Queue<Action>();
            this._selectedItems = new DataGridSelectedItemsCollection(this);
            this._rowGroupHeaderStyles = new ObservableCollection<Style>();
            this._rowGroupHeaderStyles.CollectionChanged += RowGroupHeaderStyles_CollectionChanged;
            this._rowGroupHeaderStylesOld = new List<Style>();
            this.RowGroupHeadersTable = new IndexToValueTable<DataGridRowGroupInfo>();
            this._validationItems = new Dictionary<INotifyDataErrorInfo, string>();
            this._validationResults = new List<ValidationResult>();
            this._bindingValidationResults = new List<ValidationResult>();
            this._propertyValidationResults = new List<ValidationResult>();
            this._indeiValidationResults = new List<ValidationResult>();

            this.DisplayData = new DataGridDisplayData(this);
            this.ColumnsInternal = CreateColumnsInstance();

            this.RowHeightEstimate = DATAGRID_defaultRowHeight;
            this.RowDetailsHeightEstimate = 0;
            this._rowHeaderDesiredWidth = 0;

            this.DataConnection = new DataGridDataConnection(this);
            this._showDetailsTable = new IndexToValueTable<Visibility>();
            this._collapsedSlotsTable = new IndexToValueTable<Visibility>();

            this.AnchorSlot = -1;
            this._lastEstimatedRow = -1;
            this._editingColumnIndex = -1;
            this._mouseOverRowIndex = null;
            this.CurrentCellCoordinates = new DataGridCellCoordinates(-1, -1);

            this.RowGroupHeaderHeightEstimate = DATAGRID_defaultRowHeight;

            DefaultStyleKey = typeof(DataGrid);
        }
예제 #3
0
파일: DataGrid.xaml.cs 프로젝트: dfr0/moon
        public DataGrid()
        {
            this.TabNavigation = KeyboardNavigationMode.Once;
            this.KeyDown += new KeyEventHandler(DataGrid_KeyDown);
            this.KeyUp += new KeyEventHandler(DataGrid_KeyUp);
            this.GotFocus += new RoutedEventHandler(DataGrid_GotFocus);
            this.LostFocus += new RoutedEventHandler(DataGrid_LostFocus);

            this._loadedRows = new List<DataGridRow>();
            this._editingBoundCells = new List<DataGridCell>(2);
            this._selectedItems = new DataGridSelectedItemsCollection(this);
            this.SetValueNoCallback(SelectedIndexProperty, -1);

            this.DisplayData = new DataGridDisplayData();
            this.ColumnsInternal = CreateColumnsInstance();

            this.SetValueNoCallback(ColumnWidthProperty, DataGridLength.Auto);
            this.SetValueNoCallback(MaxColumnWidthProperty, DATAGRID_defaultMaxColumnWidth);
            this.SetValueNoCallback(MinColumnWidthProperty, DATAGRID_defaultMinColumnWidth);
            this.SetValueNoCallback(RowHeightProperty, double.NaN);
            this.RowHeightEstimate = DATAGRID_defaultRowHeight;
            this.RowDetailsHeightEstimate = 0;
            this._rowHeaderDesiredWidth = 0;

            this.DataConnection = new DataGridDataConnection(this);
            //this._newRowLocation = DataGridNewRowLocation.Inline;
            this._showDetailsTable = new IndexToValueTable<Visibility>();

            this.AnchorRowIndex = -1;
            this._lastEstimatedRow = -1;
            this._editingColumnIndex = -1;
            this._mouseOverRowIndex = null;
            this.CurrentCellCoordinates = new DataGridCellCoordinates(-1, -1);

            this.SetValueNoCallback(RowHeaderWidthProperty, double.NaN);
            this.SetValueNoCallback(ColumnHeaderHeightProperty, double.NaN);

            this._addedSelectedItems = new List<object>();
            this._removedSelectedItems = new List<object>();

            DefaultStyleKey = typeof(DataGrid);
        }