public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs) { if (gEventArgs.GestureObjects.Length > 1) { Card card2 = gEventArgs.GestureObjects[0] as Card; card2.MoveCard(gEventArgs.GesturePoints[0].CurrentPoint.Position.X - lastPosi.X, gEventArgs.GesturePoints[0].CurrentPoint.Position.Y - lastPosi.Y, 0); lastPosi = gEventArgs.GesturePoints[0].CurrentPoint.Position; } base.ContinueGesture(sender, gEventArgs); }
public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs) { Card c = gEventArgs.GestureObjects[0] as Card; Menu_Sort_Box b = gEventArgs.GestureObjects[1] as Menu_Sort_Box; if (!gestureControler.Control.MainWindow.MenuLayer.IsButtonInOriginPos(b)) { c.SortToGroup(b); Group_List.Add(b, c); My_Point point = gEventArgs.GesturePoints[0]; Vector v = new Vector(c.PreviousPostion.X - c.CurrentPosition.X, c.PreviousPostion.Y - c.CurrentPosition.Y); v.Normalize(); c.MoveCard(v.X * 150, v.Y * 150, 0.5); } if (Group_List.CardGroups.ContainsKey(b)) { Card[] cards = Group_List.CardGroups[b].ToArray(); foreach (Card cc in cards) { cc.Dehightlight(); } } base.TerminateGesture(sender, gEventArgs); }