Ejemplo n.º 1
0
        void OnPointerReleased(object sender, PointerRoutedEventArgs e)
        {
            if (e.IsTouch())
            {
                // 触摸模式只支持列排序
                if (_pointerID == e.Pointer.PointerId)
                {
                    ReleasePointerCapture(e.Pointer);
                    _pointerID = null;
                    ChangedSortState();
                }
                return;
            }

            if (_isDragging)
            {
                if (_dragTgtCol != null)
                {
                    // 拖拽结束
                    _owner.FinishedDrag();
                    Cols cols  = _owner.Lv.Cols;
                    int  index = cols.IndexOf(_dragTgtCol);
                    cols.Remove(Col);
                    cols.Insert(index, Col);
                    cols.Invalidate();
                }
                else
                {
                    // 列排序
                    ChangedSortState();
                }
            }
            ResetMouseState();
        }