punker76 / gong-wpf-dragdrop

The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Viewport 3D

rdegelo opened this issue · comments

I have an ItemsControl using dragdrop.
All works fine. But when I flip one of the items inside ItemsControl using Viewport3D, drop does not work in some area of the ItemsControl, and if I click ItemsControl I get some HitTest Exceptions.

I wonder if HitTest stops working after a 3D animation.
Can you help me?

If you need more info please ask me.

@rdegelo maybe same as here? #146

Thank you for the fast answer!

I don't think it is the same problem.
Please check the video below, so you can have an better idea of my problem.

http://screencast-o-matic.com/watch/cDnbIy1VR9

Thank you in advance.

@rdegelo can you show me the hit test exceptions?

Hello,
I believe if you modify GetContainerAt method to filter ViewPort3D it will work

                                    VisualTreeHelper.HitTest(itemsControl, 
                                    o => 
                                    {
                                        if (o is System.Windows.Controls.Viewport3D)
                                            return HitTestFilterBehavior.ContinueSkipSelfAndChildren;

                                        return HitTestFilterBehavior.Continue;
                                    },
                                     result =>
                                     {
                                         var itemContainer = isItemContainer
                                                               ? GongSolutions.Wpf.DragDrop.Utilities.VisualTreeExtensions.GetVisualAncestor(result.VisualHit, itemContainerType, itemsControl)
                                                               : GongSolutions.Wpf.DragDrop.Utilities.VisualTreeExtensions.GetVisualAncestor(result.VisualHit, itemContainerType);
                                         if (itemContainer != null && !hits.Contains(itemContainer) && ((UIElement)itemContainer).IsVisible == true)
                                         {
                                             hits.Add(itemContainer);
                                         }
                                         return HitTestResultBehavior.Continue;
                                     },
                                     new GeometryHitTestParameters(hitTestGeometry));

Can you confirm it won't break anything else?

@rdegelo i will change this in current source (alpha version), so you can test it out

Ok, thanks.