2012-03-26 61 views
1

Link to the Image of my App拖放功能衰竭的Scatterview項目和網格佈局

我想檢測,如果2張圖片在畫布上是NEARY對方的不是做一些與嵌入圖片,如果兩者都感動數據比較操作彼此靠近。

棕色區域是一個ScatterView,我可以放置圖片元素並將它們添加到綠色列表框中。

我可以直接從藍色列表框中拖放圖片項目到棕色放置區域。

但是當我在黃色的scatterview上首先放下它們時,我無法離開那裏將它們放在棕色的scatterview上。

<Grid ShowGridLines="True"> 
<Grid.RowDefinitions > 
    <RowDefinition Height="*" /> 
    <RowDefinition Height="Auto" /> 

</Grid.RowDefinitions> 
<Grid.ColumnDefinitions> 
    <ColumnDefinition></ColumnDefinition> 
    <ColumnDefinition></ColumnDefinition> 
    <ColumnDefinition></ColumnDefinition> 
</Grid.ColumnDefinitions> 


    <s:ScatterView 
     Grid.Row="0" 
     Grid.Column="0" 
     Grid.ColumnSpan="2" 
     Grid.RowSpan="1" 
     x:Name="ScatterLayer" 
     Background="Yellow" 
     ItemContainerStyle="{StaticResource ScatterItemStyle}" 
     AllowDrop="True" 
     ItemTemplate="{StaticResource ImageAndCaptionTemplate}" 
     ItemsSource="{Binding ScatterItems}" 
     s:SurfaceDragDrop.Drop="ScatterLayer_Drop" 
     s:SurfaceDragDrop.DragEnter="ScatterLayer_DragEnter" 
     s:SurfaceDragDrop.DragCompleted="ScatterLayer_DragCompleted" > 
    </s:ScatterView> 

    <s:SurfaceListBox 
     Grid.Row="0" Grid.Column="2" 
     AllowDrop="True" 
     x:Name="ListBoxVerticalBasket" 
     VerticalAlignment="Top" 
     Background="GreenYellow" 
     ItemsSource="{Binding Path=BasketItems}" 
     ItemTemplate="{StaticResource BasketTemplate}" > 
     <s:SurfaceListBox.ItemsPanel> 
      <ItemsPanelTemplate> 
       <StackPanel Orientation="Vertical" /> 
      </ItemsPanelTemplate> 
     </s:SurfaceListBox.ItemsPanel> 
    </s:SurfaceListBox> 

    <s:SurfaceListBox 
     Grid.Row="1" 
     Grid.Column="0" 
     Grid.ColumnSpan="2" 
     x:Name="ShoppingList" 
     AllowDrop="True" 
     s:SurfaceDragDrop.DragCompleted="OnShoppingListDragCompleted" 
     s:SurfaceDragDrop.DragCanceled="OnShoppingListDragCanceled" 
     PreviewMouseLeftButtonDown="OnShoppingListPreviewMouseLeftButtonDown" 
     PreviewMouseMove="OnShoppingListPreviewMouseMove" 
     PreviewMouseLeftButtonUp="OnShoppingListPreviewMouseLeftButtonUp" 
     ItemsSource="{Binding Path=LibraryItems}" 
     ItemTemplate="{StaticResource ImageAndCaptionTemplate}" 
     PreviewTouchDown="OnShoppingListPreviewTouchDown" 
     PreviewTouchMove="OnShoppingListPreviewTouchMove" 
     PreviewTouchUp="OnShoppingListPreviewTouchUp" 
     Background="#FF00BDD8"> 
     <s:SurfaceListBox.ItemsPanel> 
      <ItemsPanelTemplate> 
       <StackPanel Orientation="Horizontal" AllowDrop="True"/> 
      </ItemsPanelTemplate> 
     </s:SurfaceListBox.ItemsPanel> 

    </s:SurfaceListBox> 

    <s:ScatterView 
     Grid.Column="2" 
     Grid.Row="1" 
     Background="DarkGoldenrod" 
     Width="300" 
     Height="100" 
     x:Name="ScatterViewDropArea" 
     VerticalAlignment="Top" 
     HorizontalAlignment="Left" 
     AllowDrop="True" 
     s:SurfaceDragDrop.Drop="ScatterViewDropArea_Drop"> 
    </s:ScatterView> 

回答

0

我想你應該考慮使用帶有在表面SDK,而不是ScatterView購物車演示的DragDropScatterView