haithambradai / gong-wpf-dragdrop

Automatically exported from code.google.com/p/gong-wpf-dragdrop
0 stars 0 forks source link

After doublclick, item loose focus #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Customize the SchoolsExample:
1. Add a MouseDoubleClick EventHanlder to the ListBox of Pupils
2. When the MouseDoubleClick, show a messagebox
3. Close the messagebox -> the doubleclicked item looses the focus and selection

What is the expected output? What do you see instead?
The item should be focused and selected.

What version of the product are you using? On what operating system?
0.1.2 Windows 7

Please provide any additional information below.
To solve this problem, add these lines at the begin of 
"DragDrop.DragSource_PreviewMouseLeftButtonDown":
...
            if (e.ClickCount != 1)
                return;
...

Original issue reported on code.google.com by sandrogo...@gmail.com on 12 Apr 2012 at 2:28

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Drag operation should not start if e.ClickCount != 1...
Correction:

        static void DragSource_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            // Ignore the click if clickCount != 1 or the user has clicked on a scrollbar.
            if (e.ClickCount != 1 || HitTestScrollBar(sender, e))
            {
                m_DragInfo = null;
                return;
            }
.......

Original comment by sandrogo...@gmail.com on 4 Jul 2012 at 2:52

GoogleCodeExporter commented 9 years ago
hi

added this fix in current source https://github.com/punker76/gong-wpf-dragdrop
the nuget package 0.1.3.4  includes this fix

jan

Original comment by punkera...@gmail.com on 16 Feb 2013 at 10:29