private void keyb_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { Grid uIElement = sender as Grid; Panel.SetZIndex(uIElement, 1); uIElement.ReleaseMouseCapture(); Border border = InBorder(pointDic[uIElement.Name]); if (border != null) { double dx = Canvas.GetLeft(border); double dy = Canvas.GetTop(border); Canvas.SetLeft(uIElement, dx); Canvas.SetTop(uIElement, dy); positionDic[uIElement.Name].CanvasLeft = dx; positionDic[uIElement.Name].CanvasTop = dy; //var border = GetMappingBorder(uIElement); //if (border != null) //{ // borderMap[border] = null; // DoMove(border, MoveType.D); //} ReMapping(border, uIElement); } else { Position position = positionDic[uIElement.Name]; Canvas.SetLeft(uIElement, position.CanvasLeft); Canvas.SetTop(uIElement, position.CanvasTop); } }