private void DragEnded(object sender, EventArgs e) { if (CellsSwitchedListner != null) { var newListOrder = new List <int> (); for (int i = 0; i < SwitchedViewList.Count; i++) { var toindex = OriginalViewList.FindIndex(v => v == SwitchedViewList[i]); newListOrder.Add(toindex); } CellsSwitchedListner.CellsSwitched(newListOrder); } }
private int IndexOfViewbyYDelta(View view, double yDelta) { return(OriginalViewList.FindIndex(v => v == view) + (int)(Math.Sign(yDelta) * 0.5 + yDelta / (view.Height + Spacing))); }
private int OriginalIndexOfSwitchinCell(DraggableView switchingView) { return(OriginalViewList.FindIndex(v => v == switchingView)); }