TestStack / White

DEPRECATED - no longer actively maintained
Other
1.02k stars 486 forks source link

Drag and Drop Issue #239

Open shubham8486 opened 10 years ago

shubham8486 commented 10 years ago

Pre Condition: Operating System: Windows 7 .Net version 4.5 Visual Studio 2012 Premium Edition WPF Application Dragged Control: List Box Item Dragged To Control: List Box Item

We can view the application is just as the Visual Studio IDE where we are trying to drag and drop items from Tools to the Designer. But in my case both the controls are list box items.

I am trying to drag and drop Listbox item control from one part to another ListBox Item. So in this case the method Mouse.Instance.DragAndDrop(sourceItem,destinationItem) or Mouse.Instance.DragHorizontally(draggedItem, Distance) does not work and no action takes place on the UI.

But if i use the below code then it works with strange behavior. I need to click, press tab or move mouse manually and then only the action is performed. If I want to perform more than one item drag and drop then i am not able to do so.

Mouse.Instance.Location = draggedItem.ClickablePoint; Mouse.LeftDown();

       __ //Move the mouse a little down__
        Mouse.Instance.Location = new Point(draggedItem.ClickablePoint.X, draggedItem.ClickablePoint.Y + 1);

        //Move to the new window
        targetItem.Focus();

        //Set the point to drop
        Mouse.Instance.Location = targetItem.ClickablePoint;

        //Drop
        Mouse.LeftUp();
ilya-murzinov commented 10 years ago

Hello!

Can you please provide sample application (in exe or just source code) in which this problem can be repeated?

shubham8486 commented 10 years ago

Hi,

I wont be able to share exe or source beacuse of security rules. If you need any information then I can give you.

Thanks Shubham Agarwal

-----Original Message----- From: "Ilya Murzinov" notifications@github.com Sent: ‎26-‎05-‎2014 15:51 To: "TestStack/White" White@noreply.github.com Cc: "shubham8486" shubham8486@gmail.com Subject: Re: [White] Drag and Drop Issue (#239)

Hello! Can you please provide sample application (in exe or just source code) in which this problem can be repeated? — Reply to this email directly or view it on GitHub.

JakeGinnivan commented 10 years ago

What about doing file -> new wpf project. Then creating a small repro solution? Even just some xaml of the targets so we can see the structure.

Arne-B commented 8 years ago

Ran into this issue as well. Version: 0.13.3 Dealing with nested lists (WPF). Dragging an ListBoxItem from a List which is located inside another ListBoxItem.