Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
Can't Drop on Control Margin
posted

I have a stackpanel that contains collection of content. The stackpanel is the dropsource and the content are the dragsources. The purpose is that you can reorder the content on the panel. Currently I have implemented this as an ItemsControl with the Panel being the ItemsPanelTemplate as follows:

            <ItemsControl Grid.Row="0"  x:Name="ContentItemViewsControl" Margin="10,10,10,10">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical" >
                            <idd:DragDropManager.DropTarget>
                                <idd:DropTarget IsDropTarget="True"/>
                            </idd:DragDropManager.DropTarget>
                        </StackPanel>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>

Because I don't want the content to be stacked right on top of each other, I am adding a bit of margin to each of them. Unfortunately, When you are dragging the content, the place you intuitively want to drop them is in the margins and for some reason, your framework is preventing that and adding a little X in a circle that indicates that you can't drop there, although you are free to drop on to other contents. Is there a reason for this and is there a workaround?

 

p.s. If it matters, the ItemsControl is bound to an ObservableCollection<Control>

 

thanks,

-greg