This project is read-only.

Bad dragging while move documentTab between brothers

Nov 16, 2011 at 9:26 PM

I think that I found solvation (not the best, but works)

ManagedContent.cs

..............................

 protected virtual void OnDragMouseLeave(object sender, MouseEventArgs e)
{
if (!e.Handled && isMouseDown && e.LeftButton == MouseButtonState.Pressed && Manager != null)
{
if (!IsMouseCaptured)
{
Point ptMouseMove = e.GetPosition((IInputElement)System.Windows.Media.VisualTreeHelper.GetParent(this));
ManagedContent contentToSwap = null;
if (ContainerPane != null)
{
foreach (ManagedContent content in ContainerPane.Items)
{
if (content == this)
continue;

HitTestResult res = VisualTreeHelper.HitTest(content, e.GetPosition(content));
if (res != null)
{
contentToSwap = content;
break;
}
             //MY ADDITIONAL LOGIC
             res = VisualTreeHelper.HitTest(content, e.GetPosition(content) + new Vector(10, 0));
             if (res != null)
{
contentToSwap = content;
break;
}

res = VisualTreeHelper.HitTest(content, e.GetPosition(content) + new Vector(-10, 0));
if (res != null)
{
contentToSwap = content;
break;
}

               //END MY ADDITIONAL LOGIC

 

 

If you have better solve, please, write at this.