/// <summary>
        ///     Method which returns the default control for the column header drop indicator
        /// </summary>
        private Control CreateColumnHeaderDropIndicator()
        {
            Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null");

            DataGridColumnDropSeparator indicator = new DataGridColumnDropSeparator();

            indicator.ReferenceHeader = _draggingSrcColumnHeader;
            return(indicator);
        }
        // Token: 0x06005D11 RID: 23825 RVA: 0x001A305C File Offset: 0x001A125C
        private void FinishColumnHeaderDrag(bool isCancel)
        {
            this._prepareColumnHeaderDragging = false;
            this._isColumnHeaderDragging      = false;
            this._draggingSrcColumnHeader.SuppressClickEvent = false;
            if (this._columnHeaderDragIndicator != null)
            {
                this._columnHeaderDragIndicator.Visibility = Visibility.Collapsed;
                DataGridColumnFloatingHeader dataGridColumnFloatingHeader = this._columnHeaderDragIndicator as DataGridColumnFloatingHeader;
                if (dataGridColumnFloatingHeader != null)
                {
                    dataGridColumnFloatingHeader.ClearHeader();
                }
                base.RemoveVisualChild(this._columnHeaderDragIndicator);
            }
            if (this._columnHeaderDropLocationIndicator != null)
            {
                this._columnHeaderDropLocationIndicator.Visibility = Visibility.Collapsed;
                DataGridColumnDropSeparator dataGridColumnDropSeparator = this._columnHeaderDropLocationIndicator as DataGridColumnDropSeparator;
                if (dataGridColumnDropSeparator != null)
                {
                    dataGridColumnDropSeparator.ReferenceHeader = null;
                }
                base.RemoveVisualChild(this._columnHeaderDropLocationIndicator);
            }
            DragCompletedEventArgs e = new DragCompletedEventArgs(this._columnHeaderDragCurrentPosition.X - this._columnHeaderDragStartPosition.X, this._columnHeaderDragCurrentPosition.Y - this._columnHeaderDragStartPosition.Y, isCancel);

            this.ParentDataGrid.OnColumnHeaderDragCompleted(e);
            this._draggingSrcColumnHeader.InvalidateArrange();
            if (!isCancel)
            {
                int            num    = -1;
                bool           flag   = this.IsMousePositionValidForColumnDrag(2.0, out num);
                DataGridColumn column = this._draggingSrcColumnHeader.Column;
                if (column != null && flag && num != column.DisplayIndex)
                {
                    column.DisplayIndex = num;
                    DataGridColumnEventArgs e2 = new DataGridColumnEventArgs(this._draggingSrcColumnHeader.Column);
                    this.ParentDataGrid.OnColumnReordered(e2);
                }
            }
            this._draggingSrcColumnHeader           = null;
            this._columnHeaderDragIndicator         = null;
            this._columnHeaderDropLocationIndicator = null;
        }
        /// <summary>
        ///     Method which completes the column header drag. Includes raising of events and changing column display index if needed.
        /// </summary>
        private void FinishColumnHeaderDrag(bool isCancel)
        {
            Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
            _prepareColumnHeaderDragging = false;
            _isColumnHeaderDragging      = false;

            _draggingSrcColumnHeader.SuppressClickEvent = false;

            if (_columnHeaderDragIndicator != null)
            {
                _columnHeaderDragIndicator.Visibility = Visibility.Collapsed;
                DataGridColumnFloatingHeader floatingHeader = _columnHeaderDragIndicator as DataGridColumnFloatingHeader;
                if (floatingHeader != null)
                {
                    floatingHeader.ClearHeader();
                }

                RemoveVisualChild(_columnHeaderDragIndicator);
            }

            if (_columnHeaderDropLocationIndicator != null)
            {
                _columnHeaderDropLocationIndicator.Visibility = Visibility.Collapsed;
                DataGridColumnDropSeparator separator = _columnHeaderDropLocationIndicator as DataGridColumnDropSeparator;
                if (separator != null)
                {
                    separator.ReferenceHeader = null;
                }

                RemoveVisualChild(_columnHeaderDropLocationIndicator);
            }

            DragCompletedEventArgs dragCompletedEventArgs = new DragCompletedEventArgs(
                _columnHeaderDragCurrentPosition.X - _columnHeaderDragStartPosition.X,
                _columnHeaderDragCurrentPosition.Y - _columnHeaderDragStartPosition.Y,
                isCancel);

            ParentDataGrid.OnColumnHeaderDragCompleted(dragCompletedEventArgs);
            _draggingSrcColumnHeader.InvalidateArrange();

            if (!isCancel)
            {
                int  newDisplayIndex      = -1;
                bool dragEndPositionValid = IsMousePositionValidForColumnDrag(
                    2.0,
                    out newDisplayIndex);

                DataGridColumn column = _draggingSrcColumnHeader.Column;
                if (column != null && dragEndPositionValid && newDisplayIndex != column.DisplayIndex)
                {
                    column.DisplayIndex = newDisplayIndex;

                    DataGridColumnEventArgs columnEventArgs = new DataGridColumnEventArgs(_draggingSrcColumnHeader.Column);
                    ParentDataGrid.OnColumnReordered(columnEventArgs);
                }
            }

            _draggingSrcColumnHeader           = null;
            _columnHeaderDragIndicator         = null;
            _columnHeaderDropLocationIndicator = null;
        }