private void AssociatedObject_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { if (_dragGhost != null) { // ゴーストの位置を更新 _dragGhost.Position = CursorInfo.GetNowPosition(AssociatedObject); } }
private void listBoxItem_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { if (dragGhost != null) { var p = CursorInfo.GetNowPosition(this); var loc = this.PointFromScreen(lstbxUseModules.PointToScreen(new Point(0, 0))); dragGhost.LeftOffset = p.X - loc.X; dragGhost.TopOffset = p.Y - loc.Y; } }
/// <summary> /// ゴーストの移動処理 /// Window全体に、ゴーストが移動するタイプのドラッグを想定している /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void QueryContinueDragHandler(object sender, QueryContinueDragEventArgs e) { if (!this.IsDragEnable) { return; } if (this.dragGhost != null) { var p = CursorInfo.GetNowPosition((Visual)this.dragItem); this.dragGhost.LeftOffset = p.X; this.dragGhost.TopOffset = p.Y - 32; } }