我有一个列表视图,在列表视图中,您可以点击一个订单号,它会弹出一个网格来编辑订单的详细信息!
它弹出的这个网格是可以通过这段代码拖拽的(tt是一个翻译形式):
Point m_start;
Vector m_startOffset;
private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
{
m_start = e.GetPosition(mainWindow);
m_startOffset = new Vector(tt.X, tt.Y);
gridShippingInstructionsForOrder.CaptureMouse();
}
private void Grid_MouseMove(object sender, MouseEventArgs e)
{
if (gridShippingInstructionsForOrder.IsMouseCaptured)
{
Vector offset = Point.Subtract(e.GetPosition(mainWindow), m_start);
tt.X = m_startOffset.X + offset.X;
tt.Y = m_startOffset.Y + offset.Y;
}
}
private void Grid_MouseUp(object sender, MouseButtonEventArgs e)
{
gridShippingInstructionsForOrder.ReleaseMouseCapture();
}
现在的问题是,当您点击屏幕底部的一个订单时,它会弹出网格的一半网格,当您将其拖到屏幕上时,它会被切成两半! (即使将其拖回屏幕中间后)